Skip to content

Typescript angular2 typings #4795

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

Closed
wants to merge 188 commits into from
Closed

Typescript angular2 typings #4795

wants to merge 188 commits into from

Conversation

BastiOfBerlin
Copy link
Contributor

This also removes the dependency to the typings project.
Issue #4761

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch 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)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

This PR changes the way typescript's typings are resolved, from the old-way of utilizing the typings project to using @types/* npm packages, which is the default way for typescript2.

A big drawback of the typings project was that it could not be installed offline and relied on an own registry.

The README has also been updated to reflect the changes, outline the use of @angular/cli's environments and show how to use npm link.

jimschubert and others added 30 commits May 23, 2016 21:54
This update allows the root Dockerfile to be used as a development
container and updates run-in-docker.sh to use the same entrypoint script
while maintaining backward compatibility for anyone who has scripted
mappings to /gen and /root/.m2/repository.
Signed-off-by: weiyang <weiyang.ones@gmail.com>
When a string enumeration has the empty string as one of its available
values, the generated code for many languages is invalid because the
empty string can not be used as an identifier.  As with numbers and
symbols, provide a mapping to an English name which can be used as a
replacement.  In this case, "empty" for the empty string/empty value.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
…required switch, in place of only show the field type by default (#4489)
* Fix Gson parsing of Joda DateTime without millis

The DateTimeFormatter returned by ISODateTimeFormat.dateTime() only
parses dates with millisecond values, and throws
IllegalArgumentException when milliseconds are not present.  The
date-time construct from RFC 3339 Section 5.6 referenced by the
Swagger/OpenAPI spec allows fractional second values to be omitted.
This results in valid date-time values being rejected by the generated
code.

This commit fixes the problem by using .dateOptionalTimeParser() for
parsing, which correctly handles date-time values without fractional
seconds.  A previous version of this commit used .dateTimeParser(),
which accepted a time without a date and was considered too liberal.
Note that .dateTime() must still be used for printing, which is not
supported by .dateTimeParser().

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* Fix akka-scala date-time parser with Joda

As in the previous commit, which fixed Java generators,
ISOISODateTimeFormat.dateOptionalTimeParser() should be used for
date-time parsing and ISOISODateTimeFormat.dateTime() for printing.
Apply the same change to akka-scala.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
* [swift3] allow POST with both body and query parameters

* Correctly support non-string and optional query parameters.
* Preliminary implementation for issue-4416

* Updated README.md with  reserved-words-mappings  parameter.
* Fixes for issue 4226. Detects and warns about more than one inline object; sets discriminator on CodegenModel; Adds templates to other Java languages
Changes to be committed:
	modified:   modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
	modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache

* Add vendor extension for x-discriminator-value
Changes to be committed:
	modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache

* Add "visible = true" to @JsonTypeInfo jackson annotations for Java languages
Changes to be committed:
modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
* add script to detect carriage return

* add check for generator as well

* add fail fast to travis config

* remove tab

* move scripts under bin/utils

* remove carriage return

* move scripts to bin/utils
fehguy and others added 15 commits February 7, 2017 10:35
[dockerfile] Replace 'maven:3.3-jdk-7' with 'maven:3-jdk-7-alpine'
* remove jersey templates #4720

* regenerate sample with jaxrs-spec templates #4720
…tor (#4740)

* [Java-Feign] Fixed String comparison using equals instead of == operator

* [Java-Feign] Updated ApiClient with ./bin/java-petstore-feign.sh
* [Java-Feign] Fixed String comparison using equals instead of == operator

* [Java-Feign] Updated ApiClient with ./bin/java-petstore-feign.sh

* [Java-retrofit] Fix for #4750 String comparison with equals
This also removes the dependency to the typings project.
Issue #4761
@BastiOfBerlin
Copy link
Contributor Author

Since this might be a breaking change (depending on typescript 2), I filed the PR against 2.3.0, but I developed against master, resulting in a bunch of conflicting files. Hope you can help to merge? @wing328 ?

@kenisteward
Copy link
Contributor

@BastiOfBerlin I have made a PR that I expect will be merged soon either to this or to master. (#4766) In that it changes the abstract typescript to generate typings for all. I will be making another PR to update those to only use @types instead but this should be done at the Abstract scale not per client

@BastiOfBerlin
Copy link
Contributor Author

@kenisteward When do you expect this to work? Maybe it makes sense to work together?

@wing328
Copy link
Contributor

wing328 commented Mar 17, 2017

@BastiOfBerlin I think what I'll do is to cherry-pick 9444c49

@wing328
Copy link
Contributor

wing328 commented Jun 26, 2017

@kenisteward are you ok if I just cherry-pick 9444c49?

For #4766 (comment), if you've completed the test and it's ready for merge, let me know.

@kenisteward
Copy link
Contributor

@wing328 looking at 9444c49 it looks like you should be able to chery-pick it okay.

As far as #4766 goes I have not tested with all current changes yet. I may have time next week to do this but I will be in the middle of trying to integrate the changes from SCGen 2.3.0 into our build process.

@wing328
Copy link
Contributor

wing328 commented Jun 26, 2017

@kenisteward thanks for reviewing. I'll do it tomorrow with a new PR

cc @BastiOfBerlin

@wing328
Copy link
Contributor

wing328 commented Jul 27, 2017

Closed via #5966

@wing328 wing328 closed this Jul 27, 2017
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.