-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AN-242] Update MethodQuery schema in Swagger docs #1482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to move what used to be the default into an example section in the description fields instead? It does look like useful information, but I agree that they are not defaults
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaults are pretty much already used like examples, I do find them useful in this context.
@aednichols I removed the defaults in line with the specification, which states that "[t]he default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided." Do we often enough use defaults contrary to this definition to represent examples that are not actually used as defaults by the backend that I should leave them as is? |
If there's a way to adopt the spec and preserve the example payloads, I'm on board with that. |
It looks like Leonardo does something reasonable with the |
@LizBaldo @aednichols Please take a look at the updated PR comment and let me know what you think. I added the example property values directly to the schema, and I confirmed that this does populate the "Example Value" for the request body in the endpoint that uses it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
Most likely, this Swagger was written before example
existed. Good to get things up to date.
Jira ticket: https://broadworkbench.atlassian.net/browse/AN-242
Context
The MethodQuery schema in Swagger is used only by a single endpoint: POST
/api/methods
. The description of this endpoint specifies thatnamespace
,name
,payload
, andentityType
must be included in the request body, which has been verified, but the MethodQuery schema does not list these properties as required. Also, the schema provides default values for all of its properties, none of which are actually used by Orchestration in the case that they are not provided.Changes
namespace
,name
,payload
, andentityType
properties required and to change all default property values to example property values.Testing
Visual aids
Before:
After:
I, the developer opening this PR, do solemnly pinky swear that:
In all cases: