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

Missing Minimum and Maximum Property in OpenAPI Generation #1365

Closed
mdaneri opened this issue Jul 24, 2024 · 0 comments · Fixed by #1369
Closed

Missing Minimum and Maximum Property in OpenAPI Generation #1365

mdaneri opened this issue Jul 24, 2024 · 0 comments · Fixed by #1369
Labels

Comments

@mdaneri
Copy link
Contributor

mdaneri commented Jul 24, 2024

Bug Report: Missing Minimum Property in OpenAPI Generation

Describe the Bug

The -Minimum and -Maximum parameters are not converted to the appropriate properties in the OpenAPI specification when the value is 0.

Steps To Reproduce

  1. Run the following PowerShell command:

    New-PodeOANumberProperty -Name 'Progress' -Description 'The async operation percentage progress' -Minimum 0 -Maximum 100
  2. This generates the following OpenAPI YAML:

    Progress: 
      type: number
      description: The async operation percentage progress
      maximum: 100

The minimum property is missing in the generated YAML.

Expected Behavior

The generated OpenAPI YAML should include both the minimum and maximum properties when they are specified, even if the value is 0. The corrected YAML should look like this:

Progress: 
  type: number
  description: The async operation percentage progress
  minimum: 0
  maximum: 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
1 participant