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

[dart][core] Fix reservedWordsMappings #12436

Merged
merged 2 commits into from May 25, 2022

Conversation

kuhnroyal
Copy link
Contributor

  • fixes [REQ] Define custom reserved words #12336
  • [core] Fix naming of reservedWordsMappings
    • GeneratorSettings used a wrong name (missing s) which resulted in config loaded from YAMl files not working
  • [dart] Respect reservedWordsMappings when checking for reserved words

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/utils/export_docs_generators.sh
    
    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*.
    For Windows users, please run the script in Git BASH.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

CC @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08) - please give your opinion on the linked issue

* `GeneratorSettings` used a wrong name (missing `s`) which resulted in config loaded from YAMl files not working
@@ -52,7 +52,7 @@ public final class GeneratorSettings implements Serializable {
private final Map<String, String> importMappings;
private final Map<String, String> inlineSchemaNameMappings;
private final Set<String> languageSpecificPrimitives;
private final Map<String, String> reservedWordMappings;
private final Map<String, String> reservedWordsMappings;
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling this might break other PRs that are in progress and use this variable or getter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well that needs to be solved in whatever PR is merged last :)

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a change in public API of openapi-generator. this will also break external forks of openapi generators that a lot of companies manage on their own, it's not really dart related

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. According to the Docs, this is what it should be named like and what the CLI arg is named like.
This just brings the parser for YAML config in line.
See https://openapi-generator.tech/docs/usage/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imho this is a bug and not matching the docs.

Copy link
Member

Choose a reason for hiding this comment

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

What about updating the doc instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wing328 The [--reserved-words-mappings <reserved word mappings>...] works correct for CLI args, just not for YAML-file configuration because of the typo. There is no separate documentation for the config file, so I think it should be fixed to match.

Copy link
Member

Choose a reason for hiding this comment

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

ok. let's go with this fix. Thanks for the PR as always

@wing328 wing328 marked this pull request as ready for review May 25, 2022 02:37
@wing328 wing328 requested a review from jimschubert as a code owner May 25, 2022 02:37
@wing328 wing328 merged commit 111675b into OpenAPITools:master May 25, 2022
@wing328 wing328 added this to the 6.0.0 milestone May 25, 2022
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.

[REQ] Define custom reserved words
3 participants