-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor OpenAPI plugin to use POJOs
The OpenAPI plugin has now been refactored to use strongly-typed POJOs rather than the more dynamic Node-based configuration. This is possible because of the NodeMapper. Now OpenAPI's config extends from JSON Schema's config. All configuration prefixes were removed from OpenAPI keys, but the plugin will handle loading the deprecated form of "openapi." when parsing configuration settings. Additional configuration settings used to configure conversion plugins for either OpenAPI or JSON Schema are contained in the "extensions" property. This property can be access from the JsonSchemaConfig object and deserialized into a desired POJO using `getExtensions(Class type)`. This allows typed access to additional configuration settings along with validation. Subsequent access to the same type is cached.
- Loading branch information
Showing
36 changed files
with
936 additions
and
623 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
...openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file 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 software.amazon.smithy.aws.apigateway.openapi; | ||
|
||
/** | ||
* API Gateway OpenAPI configuration. | ||
*/ | ||
public final class ApiGatewayConfig { | ||
|
||
private boolean disableCloudFormationSubstitution; | ||
|
||
public boolean getDisableCloudFormationSubstitution() { | ||
return disableCloudFormationSubstitution; | ||
} | ||
|
||
/** | ||
* Disables CloudFormation substitutions of specific paths when they contain | ||
* ${} placeholders. When found, these are expanded into CloudFormation Fn::Sub | ||
* intrinsic functions. | ||
* | ||
* @param disableCloudFormationSubstitution Set to true to disable intrinsics. | ||
*/ | ||
public void setDisableCloudFormationSubstitution(boolean disableCloudFormationSubstitution) { | ||
this.disableCloudFormationSubstitution = disableCloudFormationSubstitution; | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
...napi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayConstants.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
...way-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/package-info.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.