forked from loafle/openapi-generator-original
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort * Update integration testing expectations * Regenerate files
This commit is contained in:
@@ -237,6 +237,16 @@ Class | Method | HTTP request | Description
|
||||
## Documentation for Authorization
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### petstore_auth
|
||||
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
||||
### api_key
|
||||
|
||||
|
||||
@@ -251,12 +261,12 @@ Authentication schemes defined for the API:
|
||||
- **API key parameter name**: api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### bearer_test
|
||||
### http_basic_test
|
||||
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### http_basic_test
|
||||
### bearer_test
|
||||
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
@@ -266,16 +276,6 @@ Authentication schemes defined for the API:
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### petstore_auth
|
||||
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
||||
|
||||
## Recommendation
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ public class Example {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
@@ -73,7 +73,7 @@ null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
@@ -181,11 +181,11 @@ public class Example {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
List<String> status = Arrays.asList("available"); // List<String> | Status values that need to be considered for filter
|
||||
try {
|
||||
@@ -215,7 +215,7 @@ public class Example {
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
@@ -253,11 +253,11 @@ public class Example {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
List<String> tags = Arrays.asList(); // List<String> | Tags to filter by
|
||||
try {
|
||||
@@ -287,7 +287,7 @@ public class Example {
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
@@ -399,11 +399,11 @@ public class Example {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
@@ -432,7 +432,7 @@ null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth)
|
||||
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
|
||||
@@ -197,6 +197,14 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
Authentication auth = null;
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("petstore_auth");
|
||||
}
|
||||
if (auth instanceof OAuth) {
|
||||
authentications.put("petstore_auth", auth);
|
||||
} else {
|
||||
authentications.put("petstore_auth", new OAuth(basePath, ""));
|
||||
}
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("api_key");
|
||||
}
|
||||
@@ -213,14 +221,6 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
} else {
|
||||
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||
}
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("bearer_test");
|
||||
}
|
||||
if (auth instanceof HttpBearerAuth) {
|
||||
authentications.put("bearer_test", auth);
|
||||
} else {
|
||||
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
|
||||
}
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("http_basic_test");
|
||||
}
|
||||
@@ -229,20 +229,20 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
} else {
|
||||
authentications.put("http_basic_test", new HttpBasicAuth());
|
||||
}
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("bearer_test");
|
||||
}
|
||||
if (auth instanceof HttpBearerAuth) {
|
||||
authentications.put("bearer_test", auth);
|
||||
} else {
|
||||
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
|
||||
}
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("http_signature_test");
|
||||
}
|
||||
if (auth instanceof HttpSignatureAuth) {
|
||||
authentications.put("http_signature_test", auth);
|
||||
}
|
||||
if (authMap != null) {
|
||||
auth = authMap.get("petstore_auth");
|
||||
}
|
||||
if (auth instanceof OAuth) {
|
||||
authentications.put("petstore_auth", auth);
|
||||
} else {
|
||||
authentications.put("petstore_auth", new OAuth(basePath, ""));
|
||||
}
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" };
|
||||
|
||||
return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody,
|
||||
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
|
||||
@@ -242,7 +242,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" };
|
||||
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
|
||||
@@ -316,7 +316,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" };
|
||||
|
||||
GenericType<List<Pet>> localVarReturnType = new GenericType<List<Pet>>() {};
|
||||
|
||||
@@ -458,7 +458,7 @@ public class PetApi {
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "http_signature_test", "petstore_auth" };
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth", "http_signature_test" };
|
||||
|
||||
return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody,
|
||||
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
|
||||
|
||||
Reference in New Issue
Block a user