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

[BUG][DART] Non-required non-nullable field is always assigned null value if value not present #18647

Open
5 of 6 tasks
alexpyc opened this issue May 12, 2024 · 0 comments
Open
5 of 6 tasks

Comments

@alexpyc
Copy link

alexpyc commented May 12, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Dart generator always insert null for non-required non-nullable field if a value is not provided. However, it seems not the specified behaviour.

openapi-generator version

7.5.0

OpenAPI declaration file content or url
    UpdateUser:
      type: object
      required: []
      properties:
        name:
          type: string
          example: testName
          nullable: false
        (...)
Generation Details

java -jar openapi-generator-cli.jar generate -i {input filename} -g dart -o {output directory name}

Steps to reproduce

Generate output with the above code snippet

Related issues/PRs

8002e55

Suggest a fix

This PR comment should point out the issue. Non-required, non-nullable field should not by default assign a null value which should be contradictory to how JSON schema treats non-required field.

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

No branches or pull requests

1 participant