openapi-generator/samples/client/petstore/java/jersey2-java6/docs
Benjamin Douglas 9058099e5b Add alias type definitions for Java
When a spec defines a Model at the top level that is a non-aggretate type (such
as string, number or boolean), it essentially represents an alias for the simple
type. For example, the following spec snippet creates an alias of the boolean
type that for all intents and purposes acts just like a regular boolean.

    definitions:
      JustABoolean:
        type: boolean

This can be modeled in some languages through built-in mechanisms, such as
typedefs in C++. Java, however, just not have a clean way of representing this.

This change introduces an internal mechanism for representing aliases. It
maintains a map in DefaultCodegen that tracks these types of definitions, and
wherever it sees the "JustABoolean" type in the spec, it generates code that
uses the built-in "Boolean" instead.

This functionality currenlty only applies to Java, but could be extended to
other languages later.

The change adds a few examples of this to the fake endpoint spec for testing,
which means all of the samples change as well.
2017-04-17 12:58:31 -07:00
..
AdditionalPropertiesClass.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
Animal.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
AnimalFarm.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
ArrayOfArrayOfNumberOnly.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
ArrayOfNumberOnly.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
ArrayTest.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
Capitalization.md Update samples for java/jersey2-java6 (and fix artifact ID) (#5118) 2017-03-23 15:22:14 +08:00
Cat.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
Category.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
ClassModel.md Update samples for java/jersey2-java6 (and fix artifact ID) (#5118) 2017-03-23 15:22:14 +08:00
Client.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
Dog.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
EnumArrays.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
EnumClass.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
EnumTest.md Update samples for java/jersey2-java6 (and fix artifact ID) (#5118) 2017-03-23 15:22:14 +08:00
FakeApi.md Add alias type definitions for Java 2017-04-17 12:58:31 -07:00
FormatTest.md Update samples for java/jersey2-java6 (and fix artifact ID) (#5118) 2017-03-23 15:22:14 +08:00
HasOnlyReadOnly.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
MapTest.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
MixedPropertiesAndAdditionalPropertiesClass.md Update samples for java/jersey2-java6 (and fix artifact ID) (#5118) 2017-03-23 15:22:14 +08:00
Model200Response.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
ModelApiResponse.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
ModelReturn.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
Name.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
NumberOnly.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
Order.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
OuterComposite.md Add alias type definitions for Java 2017-04-17 12:58:31 -07:00
OuterEnum.md Update samples for java/jersey2-java6 (and fix artifact ID) (#5118) 2017-03-23 15:22:14 +08:00
Pet.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
PetApi.md Updating samples after #5232. (#5243) 2017-03-30 01:28:53 +08:00
ReadOnlyFirst.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
SpecialModelName.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
StoreApi.md update java jersey2 petstore clients 2017-04-01 16:19:31 +08:00
Tag.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
User.md add test for java6 jersey2 client 2016-10-20 11:12:31 +08:00
UserApi.md Updating samples after #5232. (#5243) 2017-03-30 01:28:53 +08:00