forked from loafle/openapi-generator-original
		
	Minor improvements to OpenAPI Generator Online (#54)
* add copyright note, dockerfile * update online generator doc
This commit is contained in:
		
							parent
							
								
									8dd46a3fb9
								
							
						
					
					
						commit
						7c5dfbfa01
					
				@ -5,26 +5,26 @@ One can also generate API client or server using the online openapi-generator.
 | 
			
		||||
Here are the steps to run it locally:
 | 
			
		||||
```
 | 
			
		||||
mvn clean install
 | 
			
		||||
cd openapi-generator-online
 | 
			
		||||
mvn jetty:run
 | 
			
		||||
cd modules/openapi-generator-online
 | 
			
		||||
mvn spring-boot:run
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
For example, to generate Ruby API client, simply send the following HTTP request using curl:
 | 
			
		||||
```sh
 | 
			
		||||
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' https://localhost:8080/api/gen/clients/ruby
 | 
			
		||||
curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' http://localhost:8080/api/gen/clients/ruby
 | 
			
		||||
```
 | 
			
		||||
Then you will receieve a JSON response with the URL to download the zipped code.
 | 
			
		||||
 | 
			
		||||
To customize the SDK, you can `POST` to `https://localhost:8080/gen/clients/{language}` with the following HTTP body:
 | 
			
		||||
To customize the SDK, you can `POST` to `http://localhost:8080/gen/clients/{language}` with the following HTTP body:
 | 
			
		||||
```json
 | 
			
		||||
{
 | 
			
		||||
  "options": {},
 | 
			
		||||
  "swaggerUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
 | 
			
		||||
  "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
in which the `options` for a language can be obtained by submitting a `GET` request to `https://locahost:8080/api/gen/clients/{language}`:
 | 
			
		||||
in which the `options` for a language can be obtained by submitting a `GET` request to `http://locahost:8080/api/gen/clients/{language}`:
 | 
			
		||||
 | 
			
		||||
For example, `curl https://localhost:8080/api/gen/clients/python` returns
 | 
			
		||||
For example, `curl http://localhost:8080/api/gen/clients/python` returns
 | 
			
		||||
```json
 | 
			
		||||
  "packageName":{
 | 
			
		||||
    "opt":"packageName",
 | 
			
		||||
@ -53,15 +53,15 @@ To set package name to `pet_store`, the HTTP body of the request is as follows:
 | 
			
		||||
  "options": {
 | 
			
		||||
    "packageName": "pet_store"
 | 
			
		||||
  },
 | 
			
		||||
  "swaggerUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
 | 
			
		||||
  "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
and here is the curl command:
 | 
			
		||||
```sh
 | 
			
		||||
curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' https://localhost:8080/api/gen/clients/python
 | 
			
		||||
curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' http://localhost:8080/api/gen/clients/python
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Instead of using `swaggerUrl` with an URL to the OpenAPI spec, one can include the spec in the JSON payload with `spec`, e.g.
 | 
			
		||||
Instead of using `openAPIUrl` with an URL to the OpenAPI spec, one can include the spec in the JSON payload with `spec`, e.g.
 | 
			
		||||
```json
 | 
			
		||||
{
 | 
			
		||||
  "options": {},
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								modules/openapi-generator-online/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								modules/openapi-generator-online/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
FROM openjdk:8-jre-alpine
 | 
			
		||||
  
 | 
			
		||||
WORKDIR /generator
 | 
			
		||||
 | 
			
		||||
COPY target/openapi-generator-online-1.0.0.jar /generator/openapi-generator-online-1.0.0.jar
 | 
			
		||||
 | 
			
		||||
ENV GENERATOR_HOST=http://localhost
 | 
			
		||||
 | 
			
		||||
EXPOSE 8080
 | 
			
		||||
 | 
			
		||||
CMD ["java", "-jar", "/generator/openapi-generator-online-1.0.0.jar"]
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
    "swagger": "2.0",
 | 
			
		||||
    "title": "Petstore Sample API",
 | 
			
		||||
    "info": {
 | 
			
		||||
      "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
 | 
			
		||||
      "description": "A sample API that uses a petstore as an example to demonstrate features in the OpenAPI-2.0 specification",
 | 
			
		||||
      "title": "Petstore Sample API",
 | 
			
		||||
      "contact": {
 | 
			
		||||
        "name": "Wordnik API Team"
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.CommandLineRunner;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.api;
 | 
			
		||||
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.api;
 | 
			
		||||
 | 
			
		||||
import org.springframework.web.context.request.NativeWebRequest;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.0.0-SNAPSHOT).
 | 
			
		||||
 * https://openapi-generator.tech
 | 
			
		||||
@ -50,7 +67,7 @@ public interface GenApi {
 | 
			
		||||
            @ApiResponse(code = 200, message = "successful operation", response = ResponseCode.class) })
 | 
			
		||||
    @RequestMapping(value = "/gen/clients/{language}",
 | 
			
		||||
            method = RequestMethod.POST)
 | 
			
		||||
    default ResponseEntity<ResponseCode> generateClient(@ApiParam(value = "The target language for the client library",required=true, allowableValues = "ada, akka-scala, android, apex, bash, clojure, cpprest, csharp, csharp-dotnet2, cwiki, dart, dynamic-html, eiffel, elixir, elm, erlang-client, flash, go, groovy, haskell-http-client, html, html2, java, javascript, javascript-closure-angular, jaxrs-cxf-client, jmeter, kotlin, lua, objc, perl, php, powershell, python, qt5cpp, r, ruby, rust, scala, scalaz, swagger, swagger-yaml, swift, swift3, swift4, tizen, typescript-angular, typescript-angularjs, typescript-aurelia, typescript-fetch, typescript-jquery, typescript-node") @PathVariable("language") String language,@ApiParam(value = "Configuration for building the client library" ,required=true )  @Valid @RequestBody GeneratorInput generatorInput) {
 | 
			
		||||
    default ResponseEntity<ResponseCode> generateClient(@ApiParam(value = "The target language for the client library",required=true, allowableValues = "ada, akka-scala, android, apex, bash, clojure, cpprest, csharp, csharp-dotnet2, cwiki, dart, dynamic-html, eiffel, elixir, elm, erlang-client, flash, go, groovy, haskell-http-client, html, html2, java, javascript, javascript-closure-angular, jaxrs-cxf-client, jmeter, kotlin, lua, objc, perl, php, powershell, python, qt5cpp, r, ruby, rust, scala, scalaz, openapi, openapi-yaml, swift, swift3, swift4, tizen, typescript-angular, typescript-angularjs, typescript-aurelia, typescript-fetch, typescript-jquery, typescript-node") @PathVariable("language") String language,@ApiParam(value = "Configuration for building the client library" ,required=true )  @Valid @RequestBody GeneratorInput generatorInput) {
 | 
			
		||||
        return getDelegate().generateClient(language, generatorInput);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -71,7 +88,7 @@ public interface GenApi {
 | 
			
		||||
    @RequestMapping(value = "/gen/clients/{language}",
 | 
			
		||||
            produces = { "application/json" },
 | 
			
		||||
            method = RequestMethod.GET)
 | 
			
		||||
    default ResponseEntity<Map<String, CliOption>> getClientOptions(@ApiParam(value = "The target language for the client library",required=true, allowableValues = "ada, akka-scala, android, apex, bash, clojure, cpprest, csharp, csharp-dotnet2, cwiki, dart, dynamic-html, eiffel, elixir, elm, erlang-client, flash, go, groovy, haskell-http-client, html, html2, java, javascript, javascript-closure-angular, jaxrs-cxf-client, jmeter, kotlin, lua, objc, perl, php, powershell, python, qt5cpp, r, ruby, rust, scala, scalaz, swagger, swagger-yaml, swift, swift3, swift4, tizen, typescript-angular, typescript-angularjs, typescript-aurelia, typescript-fetch, typescript-jquery, typescript-node") @PathVariable("language") String language) {
 | 
			
		||||
    default ResponseEntity<Map<String, CliOption>> getClientOptions(@ApiParam(value = "The target language for the client library",required=true, allowableValues = "ada, akka-scala, android, apex, bash, clojure, cpprest, csharp, csharp-dotnet2, cwiki, dart, dynamic-html, eiffel, elixir, elm, erlang-client, flash, go, groovy, haskell-http-client, html, html2, java, javascript, javascript-closure-angular, jaxrs-cxf-client, jmeter, kotlin, lua, objc, perl, php, powershell, python, qt5cpp, r, ruby, rust, scala, scalaz, openapi, openapi-yaml, swift, swift3, swift4, tizen, typescript-angular, typescript-angularjs, typescript-aurelia, typescript-fetch, typescript-jquery, typescript-node") @PathVariable("language") String language) {
 | 
			
		||||
        return getDelegate().getClientOptions(language);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.api;
 | 
			
		||||
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.api;
 | 
			
		||||
 | 
			
		||||
import org.openapitools.codegen.CliOption;
 | 
			
		||||
@ -56,7 +73,7 @@ public interface GenApiDelegate {
 | 
			
		||||
        getRequest().ifPresent(request -> {
 | 
			
		||||
            for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
 | 
			
		||||
                if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
 | 
			
		||||
                    ApiUtil.setExampleResponse(request, "*/*", "{  \"code\" : \"d40029be-eda6-4d62-b1ef-d05e2e91a72a\",  \"link\" : \"http://generator.swagger.io:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a\"}");
 | 
			
		||||
                    ApiUtil.setExampleResponse(request, "*/*", "{  \"code\" : \"d40029be-eda6-4d62-b1ef-d05e2e91a72a\",  \"link\" : \"http://localhost:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a\"}");
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@ -73,7 +90,7 @@ public interface GenApiDelegate {
 | 
			
		||||
        getRequest().ifPresent(request -> {
 | 
			
		||||
            for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
 | 
			
		||||
                if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
 | 
			
		||||
                    ApiUtil.setExampleResponse(request, "*/*", "{  \"code\" : \"d40029be-eda6-4d62-b1ef-d05e2e91a72a\",  \"link\" : \"http://generator.swagger.io:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a\"}");
 | 
			
		||||
                    ApiUtil.setExampleResponse(request, "*/*", "{  \"code\" : \"d40029be-eda6-4d62-b1ef-d05e2e91a72a\",  \"link\" : \"http://localhost:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a\"}");
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,27 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.configuration;
 | 
			
		||||
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Home redirection to swagger api documentation 
 | 
			
		||||
 * Home redirection to api documentation
 | 
			
		||||
 */
 | 
			
		||||
@Controller
 | 
			
		||||
public class HomeController {
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.configuration;
 | 
			
		||||
 | 
			
		||||
import org.springframework.context.annotation.Bean;
 | 
			
		||||
@ -18,12 +35,12 @@ public class OpenAPIDocumentationConfig {
 | 
			
		||||
 | 
			
		||||
    ApiInfo apiInfo() {
 | 
			
		||||
        return new ApiInfoBuilder()
 | 
			
		||||
            .title("Swagger Generator")
 | 
			
		||||
            .description("This is an online swagger codegen server.  You can find out more at https://github.com/swagger-api/swagger-codegen or on [irc.freenode.net, #swagger](http://swagger.io/irc/).")
 | 
			
		||||
            .title("OpenAPI Generator Online")
 | 
			
		||||
            .description("This is an online openapi generator server.  You can find out more at https://github.com/OpenAPITools/openapi-generator.")
 | 
			
		||||
            .license("Apache 2.0")
 | 
			
		||||
            .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
 | 
			
		||||
            .termsOfServiceUrl("")
 | 
			
		||||
            .version("2.3.1")
 | 
			
		||||
            .version("3.0.0")
 | 
			
		||||
            .contact(new Contact("","", ""))
 | 
			
		||||
            .build();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -1,15 +1,18 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Copyright 2016 SmartBear Software
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 | 
			
		||||
 * in compliance with the License. You may obtain a copy of the License at
 | 
			
		||||
 * <p>
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 | 
			
		||||
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 | 
			
		||||
 * or implied. See the License for the specific language governing permissions and limitations under
 | 
			
		||||
 * the License.
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.model;
 | 
			
		||||
 | 
			
		||||
@ -1,15 +1,18 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Copyright 2016 SmartBear Software
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 | 
			
		||||
 * in compliance with the License. You may obtain a copy of the License at
 | 
			
		||||
 * <p>
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 | 
			
		||||
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 | 
			
		||||
 * or implied. See the License for the specific language governing permissions and limitations under
 | 
			
		||||
 * the License.
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.model;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.model;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.databind.JsonNode;
 | 
			
		||||
@ -39,7 +56,7 @@ public class GeneratorInput {
 | 
			
		||||
        this.options = options;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(example = "http://petstore.swagger.io/v2/swagger.json")
 | 
			
		||||
    @ApiModelProperty(example = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml")
 | 
			
		||||
    public String getOpenAPIUrl() {
 | 
			
		||||
        return openAPIUrl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.model;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
@ -25,7 +42,7 @@ public class ResponseCode {
 | 
			
		||||
 | 
			
		||||
    @ApiModelProperty(
 | 
			
		||||
            value = "URL for fetching the generated client",
 | 
			
		||||
            example = "http://generator.swagger.io:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
 | 
			
		||||
            example = "http://localhost:8080/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
 | 
			
		||||
    public String getLink() {
 | 
			
		||||
        return link;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.service;
 | 
			
		||||
 | 
			
		||||
import org.apache.commons.io.FileUtils;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,20 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.service;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.databind.JsonNode;
 | 
			
		||||
@ -6,7 +23,7 @@ import io.swagger.v3.oas.models.OpenAPI;
 | 
			
		||||
import io.swagger.v3.parser.core.models.ParseOptions;
 | 
			
		||||
import org.openapitools.codegen.*;
 | 
			
		||||
import io.swagger.v3.parser.core.models.AuthorizationValue;
 | 
			
		||||
import io.swagger.util.Json;
 | 
			
		||||
import io.swagger.v3.core.util.Json;
 | 
			
		||||
import org.openapitools.codegen.online.model.GeneratorInput;
 | 
			
		||||
import org.slf4j.Logger;
 | 
			
		||||
import org.slf4j.LoggerFactory;
 | 
			
		||||
 | 
			
		||||
@ -1,15 +1,18 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Copyright 2016 SmartBear Software
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 | 
			
		||||
 * in compliance with the License. You may obtain a copy of the License at
 | 
			
		||||
 * <p>
 | 
			
		||||
 * http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 | 
			
		||||
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 | 
			
		||||
 * or implied. See the License for the specific language governing permissions and limitations under
 | 
			
		||||
 * the License.
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
 | 
			
		||||
 * Copyright 2018 SmartBear Software
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
package org.openapitools.codegen.online.service;
 | 
			
		||||
 | 
			
		||||
@ -2,4 +2,4 @@ springfox.documentation.swagger.v2.path=/api-docs
 | 
			
		||||
server.servlet.context-path=/api
 | 
			
		||||
server.port=8080
 | 
			
		||||
spring.jackson.date-format=org.openapitools.codegen.online.RFC3339DateFormat
 | 
			
		||||
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
 | 
			
		||||
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user