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

Fix model generator for snake case on dart-jaguar client generator #1076

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

jaumard
Copy link
Contributor

@jaumard jaumard commented Sep 21, 2018

No description provided.

@jaumard jaumard changed the title fix model generator for snake case open api definition fix model generator for snake case open api definition on dart-jaguar Sep 21, 2018
@@ -2,6 +2,7 @@ part '{{classFilename}}.jser.dart';

class {{classname}} {
{{#vars}}{{#description}} /* {{{description}}} */{{/description}}
@Alias('{{baseName}}')
Copy link
Member

Choose a reason for hiding this comment

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

@jaumard thanks for the PR. I would suggest using {{{baseName}}} as {{baseName}} may escape special characters in HTML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But here we want them to be escaped anyway. It's should be plain text only as it's the name of the JSON field

Copy link
Member

Choose a reason for hiding this comment

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

@jaumard We've encountered some edge cases before (e.g. JSON key is "student"). I don't think these occur very often but still prefer using {{{baseName}}} to make it consistent with other generators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem :) it's done ^^

@wing328
Copy link
Member

wing328 commented Sep 24, 2018

cc @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09)

Do we need a similar fix in the dart client generator? I see any reference to "Alias" in the samples at the moment:

$ grep -R Alias samples/client/petstore/dart/*
$ grep -R Alias samples/client/petstore/dart2/*

@jaumard
Copy link
Contributor Author

jaumard commented Sep 24, 2018

@wing328 @Alias is specific to jaguar for the serialization so I'll say it's not needed for other dart generator

@wing328
Copy link
Member

wing328 commented Sep 24, 2018

@jaumard ah ok. Thanks for the explanation.

@wing328 wing328 merged commit df61cd9 into OpenAPITools:master Sep 25, 2018
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
@wing328 wing328 changed the title fix model generator for snake case open api definition on dart-jaguar Fix model generator for snake case on dart-jaguar client generator Mar 13, 2019
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.

None yet

2 participants