title: Springdoc-OpenAPI with path parameters and command object
body: <p>I am getting validation errors in my Springdoc generated OpenAPI spec and can't see to find an example online that matches how my Java code is formed.</p>
  <p>I am trying to generate an OpenAPI spec with Springdoc for a Spring Boot controller. I have a mapping for a path that has multiple path variables and the method signature accepts a command object (the command object is automatically constructed from these path variables).
  Swagger-UI.html seems to work more or less but the generated JSON/YAML spec does not appear to be valid.</p>
  <p>Code snippet I'm referring to:</p>
  <pre><code>@GetMapping(&quot;/myPath/{foo}/{bar}/{baz}&quot;)
  public Mono&lt;MyServiceResponse&gt; doSomethingInteresting(@Valid DoSomethingInterestingCommand command) {
      return interestingService.doSomethingInteresting(command);
  }
  </code></pre>
  <p>The OpenApi snippet this generates is:</p>
  <pre><code>paths:
    '/myPath/{foo}/{bar}/{baz}':
      get:
        tags:
          - my-controller
        operationId: doSomethingInteresting
        parameters:
          - name: command
            in: query
            required: true
            schema:
              $ref: '#/components/schemas/DoSomethingInterestingCommand'
  </code></pre>
  <p>This then yields errors such as this:</p>
  <pre><code>Semantic error at paths./myPath/{foo}/{bar}/{baz}
  Declared path parameter &quot;foo&quot; needs to be defined as a path parameter at either the path or operation level
  </code></pre>
  <p>What should I do differently in order to get the generated spec to be well-formed? I am also curious as to why the swagger-ui.html page seems to be working OK, but that is less critical.</p>