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 Technical Writer
________________________

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

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 Technical Writer
________________________

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post

Highlighted
New Contributor

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

Thank you