Forum Discussion

starvsion's avatar
starvsion
New Contributor
5 years ago
Solved

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?