Contributions
Re: Using $ref in query parameters definition in OAS
Hichichepo Thank you for you suggestions and examples. They were very helpful. I still on my way to find a solution. First of all, parameters can be the list of Reference Objects. The second, the Reference Objectcannot be extended with additional properties and any properties added SHALL be ignored. Therefore the example in my upper post is incorrect. The field "in" should be removed. The third, according to$ref Syntax - $ref can beLocal Reference,Remote Reference orURL Reference. Based on this information, I believe it is possible to reference files rather than components section in OAS. parameters: - $ref: 'https://<server>:<port>/parameters/queryParameters.json' - $ref: 'https://<server>:<port>/parameters/headerParameters.json' - $ref: 'https://<server>:<port>/parameters/pathParameters.json'11 months agoPlace SwaggerHub QuestionsSwaggerHub Questions628Views0likes0CommentsRe: Using $ref in query parameters definition in OAS
Hichichepo, Thank you for the answer! I'm a little bit confused because, as I see in the first snapshot, you define query parameters in the spec for the specific call POST EntityOperations. Actually, this is what I want to avoid. And in the third figure, you have a situation where parameters refer to components, and there they refer to the external files. I think it's too complicated, don't you? Why can't we reference directly to external files in the parameters avoiding components? parameters: - in: query - $ref: 'https://<server>:<port>/parameters/queryParameters.json'11 months agoPlace SwaggerHub QuestionsSwaggerHub Questions680Views0likes2CommentsUsing $ref in query parameters definition in OAS
Hi All. I see that we can use $ref forCommon Parameters for Various Paths but is it possible to use the same approach for query parameters? Background: our data models are quite large and rich in parameters that can also be used in a GET requests as query parameters. That is why the query parameters definition in each OAS looksredundant. The idea is to use $ref, but this is explicitly not defined according to the OAS guide. Can I use such definition for query parameters? /teams: get: summary: Gets a list of teams. parameters: - in: query - $ref: '#/parameters/queryParameters.json' responses: '200': description: OK Thank you!11 months agoPlace SwaggerHub QuestionsSwaggerHub Questions731Views0likes4CommentsHow to define a JSONPath query parameter?
Hi all. How I can definea query parameter which is a JSONPath expression in OASv3? The request example: GET /v1/service?filter=[*].virtualNetworkServices[?(@.status==’reserved’)] Is my below OAS definition correct? parameters: - in: query name: filter schema: type: string allowReserved: true description: JSONPath expression Thank you!Solved702Views0likes1Comment