Skip to content

[typescript-fetch] remove namespaces in enums #2123

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

Merged
merged 8 commits into from
Mar 7, 2019
Merged

[typescript-fetch] remove namespaces in enums #2123

merged 8 commits into from
Mar 7, 2019

Conversation

cassinaooo
Copy link
Contributor

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, ./bin/openapi3/{LANG}-petstore.sh, ./bin/security/{LANG}-petstore.sh and ./bin/openapi3/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.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Fix behaviour of enums for typescript fetch, removing namespaces according to suggestions made in #1947.

@macjohnny

@cassinaooo cassinaooo changed the title Ts fetch namespaces [typescript-fetch] remove namespaces in enums Feb 11, 2019
@cassinaooo
Copy link
Contributor Author

Because of the failing tests I just realized that I messed up with AbstractTypescriptClientCodegen that is used by all typescript clients.

Should I modify all typescript templates using namespaces or should I override the postProcessModels method on TypeScriptFetchClientCodegen ?

Is there any other alternatives? Thank you in advance.

@wing328
Copy link
Member

wing328 commented Feb 13, 2019

Should I modify all typescript templates using namespaces or should I override the postProcessModels method on TypeScriptFetchClientCodegen ?

Please override postProcessModels in TypeScriptFetchClientCodegen for the time being.

@cassinaooo
Copy link
Contributor Author

cassinaooo commented Feb 13, 2019

I don't know how to solve the Circle CI problem. From what I understand 'UNCOMMITTED CHANGES ERROR' refers to my branch being out of sync with some other one.

I tried pulling from upstream master, but it shows 'Already up to date'.

Any help is appreciated.

Thanks

@macjohnny
Copy link
Member

@willianscfa

I don't know how to solve the Circle CI problem. From what I understand 'UNCOMMITTED CHANGES ERROR' refers to my branch being out of sync with some other one.

this error indicates that some samples need to be re-generated as they do not correspond to newly generated samples anymore.
in this case, it is due to my revert-commit #2128 that missed the examples, since they were generated in a different commit.
However, with #2149 the typescript angular examples should be in sync again.

in the meantime, you can simply run https://github.com/OpenAPITools/openapi-generator/blob/master/bin/typescript-angular-petstore-all.sh to re-generate the angular samples and pass CI

@macjohnny
Copy link
Member

@wing328 could you please re-trigger CI? the out-of-date angular typescript samples problem should have been resolved with #2149

@cassinaooo
Copy link
Contributor Author

@macjohnny I did a git pull upstream master, hope that triggers the CI correctly.

@macjohnny
Copy link
Member

ok, now the Go and Kotlin samples seem to be out of sync. but it should be possible to merge this PR anyway

@macjohnny
Copy link
Member

macjohnny commented Feb 19, 2019

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

@wing328
Copy link
Member

wing328 commented Feb 19, 2019

ok, now the Go and Kotlin samples seem to be out of sync. but it should be possible to merge this PR anyway

That has been fixed in the master.

@wing328 wing328 merged commit 8a0248e into OpenAPITools:master Mar 7, 2019
@wing328
Copy link
Member

wing328 commented Mar 7, 2019

Upgrade Note

The class name is added as a prefix to the enum naming:

Before: StatusEnum
After: PetStatusEnum

jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request Mar 9, 2019
* master: (758 commits)
  Add support for free form requests (OpenAPITools#2288)
  [typescript-rxjs] drop unneeded function wrapping  (OpenAPITools#2332)
  [typescript-fetch] Guard array mapping against undefined on optional array model properties (OpenAPITools#2324)
  Fix regex in Python server model code (OpenAPITools#2314)
  Add .travis.yml and Gemfile.lock to ruby security test folder (OpenAPITools#2330)
  Add a link to CSDN article (OpenAPITools#2331)
  [Maven] fix Spaces in Windows user path breaks build on test goal (OpenAPITools#2318)
  [PHP] fix bad links in Model docs (OpenAPITools#2316)
  [java]: fix datatype for non-multipart file request body (OpenAPITools#2271)
  Removed JFCote from core team (OpenAPITools#2315)
  [R sample] fix CircleCI error of outdated sample (OpenAPITools#2313)
  [Java] Bean Validation for decimalmin/max incorrect when exclusive set (OpenAPITools#2115)
  Java Spring : fix defaultValue annotation double quoted in api operation (OpenAPITools#2267)
  Java RESTEASY : fix defaultValue annotation double quoted in api operation (OpenAPITools#2268)
  [PHP] Username checks OpenAPITools#1408 (OpenAPITools#1892)
  [typescript-fetch] remove namespaces in enums (OpenAPITools#2123)
  [java-server-msf4j] fix and upgrade (OpenAPITools#2303)
  fix test script path in CONTRIBUTING.md (OpenAPITools#2290)
  Dart queryargs (OpenAPITools#2250)
  add Blueplanet language (OpenAPITools#2184)
  ...
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.

4 participants