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: remove special quotation marks from filename generation. #1157

Merged
merged 7 commits into from
Oct 4, 2018

Conversation

smasala
Copy link
Contributor

@smasala smasala commented Oct 2, 2018

Developed with @tropan

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master (3.3.x), 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09)

Description of the PR

Generics are given double left and right pointing quotation marks in the JSON declaration file:

MyModel«Set«AnotherType»»

Although the API in (TypeScript) imports the models correctly:

import { MyModel } from '../models/myModelSetAnotherType'

The filename itself still has the special punctuation marks:

myModel«Set«AnotherType»».ts

This pull request simply removes the special characters from the filename before creation by cleaning the filename string accordingly.

myModel«Set«AnotherType»».ts => myModelSetAnotherType.ts

Original Issue:
#1137

Copy link
Member

@macjohnny macjohnny left a comment

Choose a reason for hiding this comment

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

LGTM

@smasala
Copy link
Contributor Author

smasala commented Oct 2, 2018

@macjohnny The exports in the models.ts were still incorrect. The latest PR commit fixes those issues too.

@smasala
Copy link
Contributor Author

smasala commented Oct 2, 2018

@macjohnny PR is now complete

@smasala
Copy link
Contributor Author

smasala commented Oct 2, 2018

@wing328 replaced with sanitizeName()

@wing328
Copy link
Member

wing328 commented Oct 2, 2018

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@wing328 wing328 merged commit 3e3b03f into OpenAPITools:master Oct 4, 2018
@wing328
Copy link
Member

wing328 commented Oct 16, 2018

@smasala thanks again for the fix, which has been included in the v3.3.1 release: https://twitter.com/oas_generator/status/1052020299821080577

@smasala
Copy link
Contributor Author

smasala commented Oct 16, 2018

@wing328 Thanks!

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…ITools#1157)

* remove left|right point double angle quotation marks

* move to DefaultCodeGen and update TypeScriptAngularClientCodegen to reflect new clean function so that the filename AND imports are added correctly

* rename to a more accurate name :)

* shippable fixes

* shippable javadoc fix

* replaced cleanModelFilename with sanitzeName

* remove DefaultCodegen changes
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

3 participants