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

capability to generate non Opt* struct for parameters with default value #966

Open
Liooo opened this issue Jul 4, 2023 · 1 comment
Open
Labels
enhancement New feature or request openapi-features OpenAPI features support issues

Comments

@Liooo
Copy link
Contributor

Liooo commented Jul 4, 2023

The following schema generates OptInt, but in server side it never comes with Set: false because the default is specified.
Would be nice to have an generator option to make default valued parameters non Opt* in server side.

components:
  parameters:
    page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
@Liooo Liooo added enhancement New feature or request openapi-features OpenAPI features support issues labels Jul 4, 2023
@zwpaper
Copy link

zwpaper commented Mar 12, 2024

how about introducing a Default* type, like Opt*, but can return default directly:

func (d DefaultType) Get() Type {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-features OpenAPI features support issues
Projects
None yet
Development

No branches or pull requests

2 participants