How to define an optional parameter in path using swagger
<p>There is a function in my REST web service working with GET method and it has two optional parameters. </p>

<p>I tried to define it in Swagger but I encountered an error, <strong>Not a valid parameter definition</strong>, after I set the <code>required</code> as <code>false</code>.</p>

<p>I found out that if I set the <code>required</code> value as <code>true</code> the error will be gone. Here is a sample of my Swagger code.</p>

<pre><code>...
paths:
  '/get/{param1}/{param2}':
    get:
      ...
      parameters:
      - name: param1
        in: path
        description: 'description regarding param1'
        required: false
        type: string
      - name: param2
        in: path
        description: 'description regarding param2'
        required: false
        type: string
</code></pre>

<p>I didn't experience this with parameters in body or the the ones in query. I think this problem is only related to parameters in path. I could not find any solution in swagger specification files either. </p>

<p>Is there any other way to define optional parameters in Swagger or do I have any mistake in my code?</p>

<p>Any help would be appreciated.</p>