Contributions
Re: OpenAPI Discrimintors
We are already doing as you describe and only allow selection within the root level, not any of the nested arrays. The issue I am tryingto resolve is how can I write an OpenAPI spec that would describe these possibilities and support validating the output? It sounds like discriminators is not the proper way to describe this, but what options are available to accomplish this? Could you provide an example using the requests/responses I provided in the original post?1.4KViews0likes1CommentRe: OpenAPI Discrimintors
frankkilcommins,I am trying to implement the first option you gave. I want to allow the consumer to specify the properties they are interested in and only return those properties. Is there a way to utilize discriminators for that or what would be the best way to accomplish this?1.5KViews0likes3CommentsOpenAPI Discrimintors
I have been trying to figure out how to handle a situation where a query string parameter changes the response object. Here's my example: The default response is this: endpoint: http://myapi.com/pets response: { pet:{ name: "barry", color: "white", age: 17 } } It can also have a query string parameter where it adjusts the response as follows: endpoint: http://myapi.com/pets?attributes=name,color response: { pet:{ name: "barry" } } It also supports comma separated lists for the parameter as well like this: endpoint: http://myapi.com/pets response: { pet:{ name: "barry", color: "white" } } Is there a way to describe this scenario using discriminators? I know that I can list the responses as optional, but that wasn't ideal. Thanks!1.8KViews0likes5Comments