Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/jaxrs-jersey1-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server"

echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1/src/main"
rm -rf samples/server/petstore/jaxrs/jersey1/src/main
Expand Down
2 changes: 1 addition & 1 deletion bin/jaxrs-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey2 -DhideGenerationTimestamp=true"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey2 -DhideGenerationTimestamp=true,serverPort=8080"

echo "Removing files and folders under samples/server/petstore/jaxrs/jersey2/src/main"
rm -rf samples/server/petstore/jaxrs/jersey2/src/main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public AbstractJavaJAXRSServerCodegen()
cliOptions.add(new CliOption("title", "a title describing the application"));

cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations"));
cliOptions.add(new CliOption("serverPort", "The port on which the server should be started"));

}

Expand Down Expand Up @@ -83,15 +84,19 @@ public void preprocessSwagger(Swagger swagger) {
swagger.setBasePath("");
}

String host = swagger.getHost();
String port = "8080"; // Default value for a JEE Server
if ( host != null ) {
String[] parts = host.split(":");
if ( parts.length > 1 ) {
port = parts[1];
if(!this.additionalProperties.containsKey("serverPort")) {
final String host = swagger.getHost();
String port = "8080"; // Default value for a JEE Server
if ( host != null ) {
String[] parts = host.split(":");
if ( parts.length > 1 ) {
port = parts[1];
}
}

this.additionalProperties.put("serverPort", port);
}
this.additionalProperties.put("serverPort", port);

if ( swagger.getPaths() != null ) {
for ( String pathname : swagger.getPaths().keySet() ) {
Path path = swagger.getPath(pathname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public Map<String, String> createOptions() {
builder.put(JavaCXFServerCodegen.USE_ANNOTATED_BASE_PATH, USE_ANNOTATED_BASE_PATH);

builder.put(JavaCXFServerCodegen.GENERATE_NON_SPRING_APPLICATION, GENERATE_NON_SPRING_APPLICATION);
builder.put("serverPort", "3456");

return builder.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public Map<String, String> createOptions() {
builder.put(JavaCXFServerCodegen.GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR);
builder.put(JavaResteasyServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION);
builder.put(JavaResteasyEapServerCodegen.USE_SWAGGER_FEATURE, USE_SWAGGER_FEATURE);
builder.put("serverPort", "1234");

return builder.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public Map<String, String> createOptions() {

builder.put(JavaCXFServerCodegen.GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR);
builder.put(JavaResteasyServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION);
builder.put("serverPort", "1234");

return builder.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public Map<String, String> createOptions() {
//.put(JavaClientCodegen.DATE_LIBRARY, "joda")
.put("hideGenerationTimestamp", "true")
.put(JavaCXFServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION)
.put("serverPort", "2345")
.put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE);

return builder.build();
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/bash/petstore-cli
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ echo " $ops" | column -t -s ';'
echo -e " -V,--version\t\t\t\tPrint API version"
echo -e " --about\t\t\t\tPrint the information about service"
echo -e " --host $(tput setaf 6)<url>$(tput sgr0)\t\t\t\tSpecify the host URL "
echo -e " \t\t\t\t(e.g. 'https://petstore.swagger.io')"
echo -e " \t\t\t\t(e.g. 'https://petstore.swagger.io:80')"

echo -e " --force\t\t\t\tForce command invocation in spite of missing"
echo -e " \t\t\t\trequired parameters or wrong content type"
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/csharp/SwaggerClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace Example
<a name="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.FakeApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.PetApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.StoreApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.UserApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public partial class ApiClient

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default configuration and base path (http://petstore.swagger.io/v2).
/// with default configuration and base path (http://petstore.swagger.io:80/v2).
/// </summary>
public ApiClient()
{
Configuration = Configuration.Default;
RestClient = new RestClient("http://petstore.swagger.io/v2");
RestClient = new RestClient("http://petstore.swagger.io:80/v2");
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default base path (http://petstore.swagger.io/v2).
/// with default base path (http://petstore.swagger.io:80/v2).
/// </summary>
/// <param name="config">An instance of Configuration.</param>
public ApiClient(Configuration config = null)
Expand All @@ -68,15 +68,15 @@ public ApiClient(Configuration config = null)
else
Configuration = config;

RestClient = new RestClient("http://petstore.swagger.io/v2");
RestClient = new RestClient("http://petstore.swagger.io:80/v2");
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default configuration.
/// </summary>
/// <param name="basePath">The base path.</param>
public ApiClient(String basePath = "http://petstore.swagger.io/v2")
public ApiClient(String basePath = "http://petstore.swagger.io:80/v2")
{
if (String.IsNullOrEmpty(basePath))
throw new ArgumentException("basePath cannot be empty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace Example
<a name="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.FakeApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.PetApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.StoreApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IO.Swagger.Api.UserApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public partial class ApiClient

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default configuration and base path (http://petstore.swagger.io/v2).
/// with default configuration and base path (http://petstore.swagger.io:80/v2).
/// </summary>
public ApiClient()
{
Configuration = Configuration.Default;
RestClient = new RestClient("http://petstore.swagger.io/v2");
RestClient = new RestClient("http://petstore.swagger.io:80/v2");
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default base path (http://petstore.swagger.io/v2).
/// with default base path (http://petstore.swagger.io:80/v2).
/// </summary>
/// <param name="config">An instance of Configuration.</param>
public ApiClient(Configuration config = null)
Expand All @@ -68,15 +68,15 @@ public ApiClient(Configuration config = null)
else
Configuration = config;

RestClient = new RestClient("http://petstore.swagger.io/v2");
RestClient = new RestClient("http://petstore.swagger.io:80/v2");
}

/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default configuration.
/// </summary>
/// <param name="basePath">The base path.</param>
public ApiClient(String basePath = "http://petstore.swagger.io/v2")
public ApiClient(String basePath = "http://petstore.swagger.io:80/v2")
{
if (String.IsNullOrEmpty(basePath))
throw new ArgumentException("basePath cannot be empty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule SwaggerPetstore.Api.Fake do

use Tesla

plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io/v2"
plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2"
plug Tesla.Middleware.JSON

def test_client_model(body) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule SwaggerPetstore.Api.Pet do

use Tesla

plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io/v2"
plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2"
plug Tesla.Middleware.JSON

def add_pet(body) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule SwaggerPetstore.Api.Store do

use Tesla

plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io/v2"
plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2"
plug Tesla.Middleware.JSON

def delete_order(order_id) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule SwaggerPetstore.Api.User do

use Tesla

plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io/v2"
plug Tesla.Middleware.BaseUrl, "http://petstore.swagger.io:80/v2"
plug Tesla.Middleware.JSON

def create_user(body) do
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Put the package under your project folder and add the following in import:

## Documentation for API Endpoints

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Configuration struct {

func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "http://petstore.swagger.io/v2",
BasePath: "http://petstore.swagger.io:80/v2",
DefaultHeader: make(map[string]string),
APIKey: make(map[string]string),
APIKeyPrefix: make(map[string]string),
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# \FakeApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/PetApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# \PetApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/StoreApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# \StoreApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/go/go-petstore/docs/UserApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# \UserApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ApiClient {
public interface Api {}

protected ObjectMapper objectMapper;
private String basePath = "http://petstore.swagger.io/v2";
private String basePath = "http://petstore.swagger.io:80/v2";
private Map<String, RequestInterceptor> apiAuthorizations;
private Feign.Builder feignBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void setup() {
@Test
public void testApiClient() {
// the default api client is used
assertEquals("http://petstore.swagger.io/v2", apiClient.getBasePath());
assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath());

ApiClient newClient = new ApiClient();
newClient.setBasePath("http://example.com");
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/java/jersey1/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FakeApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/java/jersey1/docs/PetApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PetApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/java/jersey1/docs/StoreApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# StoreApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/java/jersey1/docs/UserApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# UserApi

All URIs are relative to *http://petstore.swagger.io/v2*
All URIs are relative to *http://petstore.swagger.io:80/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

public class ApiClient {
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
private String basePath = "http://petstore.swagger.io/v2";
private String basePath = "http://petstore.swagger.io:80/v2";
private boolean debugging = false;
private int connectionTimeout = 0;

Expand Down
Loading