Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve: Use only required params in RouteData #43 #44

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

SOHELAHMED7
Copy link
Member

@SOHELAHMED7 SOHELAHMED7 commented Sep 6, 2024

Fixes #43


It seems like there is nothing to do here.

For schema:

  /pets/{id}:
    get:
      summary: Info for a specific pet
      operationId: showPetById
      tags:
        - pets
      parameters:
        - name: id
          in: path
          required: false <---------------------------------------------------------------- here
          description: The id of the pet to retrieve
          schema:
            type: string

if params is not required then we get validation error:

Array
(
    [openApiPath] => Array
        (
            [0] => Failed to validate OpenAPI spec:<ul>
<li>[/paths/~1pets~1{id}/get/parameters/1] Parameter &#039;required&#039; must be true for &#039;in&#039;: &#039;path&#039;.</li>
</ul>
        )

)

and code generation fails.

If params is not required then we get validation error:

```
Array
(
    [openApiPath] => Array
        (
            [0] => Failed to validate OpenAPI spec:<ul>
<li>[/paths/~1pets~1{id}/get/parameters/1] Parameter &#39;required&#39; must be true for &#39;in&#39;: &#39;path&#39;.</li>
</ul>
        )

)
```

and code generation fails.
@SOHELAHMED7 SOHELAHMED7 requested a review from cebe September 6, 2024 03:45
@SOHELAHMED7 SOHELAHMED7 self-assigned this Sep 6, 2024
@SOHELAHMED7 SOHELAHMED7 linked an issue Sep 6, 2024 that may be closed by this pull request
@SOHELAHMED7 SOHELAHMED7 changed the title It seems like there is nothing to do here. Resolve: Use only required params in RouteData #43 Sep 6, 2024
@cebe cebe merged commit 3c523c2 into master Nov 12, 2024
5 checks passed
@cebe cebe deleted the 43-use-only-required-params-in-routedata branch November 12, 2024 16:01
@cebe
Copy link
Member

cebe commented Nov 12, 2024

Thanks for checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use only required params in RouteData
2 participants