Skip to content

Conversation

@vasilich6107
Copy link
Contributor

@vasilich6107 vasilich6107 commented Sep 2, 2024

Align enum and enum_inline generation result

Previously the PR(#15387) updated enum generation but forgot to change the enum_inline template

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.6.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@vasilich6107
Copy link
Contributor Author

vasilich6107 commented Sep 2, 2024

@jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08)

Also @wing328 could you pay a little bit of attention.
This PR just aligns the implementation so should be easy to review.

{{#enumVars}}
@JsonValue({{#isString}}r{{/isString}}{{{value}}})
{{{name}}},
{{^isNull}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is isNull check necessary ?

Copy link
Contributor Author

@vasilich6107 vasilich6107 Sep 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenApiSchema specifies a nullable enum to be defined including null as one of the possible values. https://swagger.io/docs/specification/data-models/enums/

We do not want thins null to be present among other items

This is why i'm filtering it out

image

@vasilich6107 vasilich6107 force-pushed the bugfix/dart-dio/align-enum-and-enum_inline-generation-results branch from 92057be to 9d0b263 Compare September 2, 2024 21:26
This reverts commit 9d0b263.
Copy link
Contributor

@ahmednfwela ahmednfwela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @wing328

@vasilich6107
Copy link
Contributor Author

Hi @wing328
All fixed and approved, could you merge

@vasilich6107
Copy link
Contributor Author

@4brunu could you help with merging the PR?

@wing328 wing328 merged commit abf9416 into OpenAPITools:master Sep 15, 2024
@wing328 wing328 added this to the 7.9.0 milestone Sep 15, 2024
@wing328
Copy link
Member

wing328 commented Sep 15, 2024

@vasilich6107 thanks for the PR, which has been merged.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants