openapi-generator/samples/server/petstore/springboot-delegate-j8
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
..
src/main Add alias type definitions for Java 2017-04-17 12:58:31 -07:00
.swagger-codegen-ignore Allows for generation of spring controller code using the delegate pattern (#4439) 2017-01-19 17:58:39 +08:00
pom.xml Updating samples for spring-stubs, springboot-delegate, springboot-delegate-j8. (#5211) 2017-03-27 15:24:18 +08:00
README.md Allows for generation of spring controller code using the delegate pattern (#4439) 2017-01-19 17:58:39 +08:00

Swagger generated server

Spring Boot Server

Overview

This server was generated by the swagger-codegen project.
By using the OpenAPI-Spec, you can easily generate a server stub.
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.

The underlying library integrating swagger to SpringBoot is springfox

Start your server as an simple java application

You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/

Change default port value in application.properties