cancel
Showing results for 
Search instead for 
Did you mean: 

OAS3 - Error on Parameter.required - Optional Parameter

SOLVED
New Contributor

OAS3 - Error on Parameter.required - Optional Parameter

The swagger doc compiles properly, just that the error is getting very annoying, so I have optional URL Query, I wrote it this way: 

 

 

 parameters: 
       - in: path
         name: query
         schema:
            type: string
         description: search query

And I receive this error: 

 

should have required property 'required' missingProperty: required

So, I changed it to: 

parameters: 
       - in: path
         name: query
         schema:
           type: string
         description: search query
         required: false

And now it shows this error: 

should be equal to one of the allowed values allowedValues: true

What am I supposed to do here? 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: OAS3 - Error on Parameter.required - Optional Parameter

Query parameters are defined using "in: query", not "in: path".


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

2 REPLIES 2
Moderator

Re: OAS3 - Error on Parameter.required - Optional Parameter

Query parameters are defined using "in: query", not "in: path".


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Contributor

Re: OAS3 - Error on Parameter.required - Optional Parameter

Thank you

New Here?
Join us and watch the welcome video:
Announcements