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

binding parameter default value with allOf schema #884

Closed
podhmo opened this issue Dec 8, 2023 · 0 comments · Fixed by #885
Closed

binding parameter default value with allOf schema #884

podhmo opened this issue Dec 8, 2023 · 0 comments · Fixed by #885

Comments

@podhmo
Copy link
Contributor

podhmo commented Dec 8, 2023

Default value binding does not work well when parameter schema has allOf.

For example, when I set a custom default value while referencing the schema with $ref, we can write it using allOf in OpenAPI 3.x.

components:
  schemas:
    TaskSortEnum:
      enum:
        - createdAt
        - -createdAt
        - updatedAt
        - -updatedA
paths:
  /tasks:
    get:
      description: ""
      operationId: ListTask
      parameters:
        - in: query
          name: sort
          schema:
            allOf:
              - $ref: '#/components/schemas/TaskSortEnum'
              - default: -createdAt

But, this doesn't work in the current implementation.

Related oapi-codegen's issue is here.

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 a pull request may close this issue.

1 participant