forked from smithy-lang/smithy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add versioning for API Gateway defaults
- Loading branch information
Showing
9 changed files
with
227 additions
and
75 deletions.
There are no files selected for viewing
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
51 changes: 51 additions & 0 deletions
51
...penapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayDefault.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,51 @@ | ||
/* | ||
* Copyright 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; | ||
|
||
import software.amazon.smithy.openapi.OpenApiConfig; | ||
import software.amazon.smithy.utils.SetUtils; | ||
import software.amazon.smithy.utils.SmithyUnstableApi; | ||
|
||
public enum ApiGatewayDefault { | ||
VERSION_2023_08_11("2023-08-11") { | ||
@Override | ||
public void setDefaults(OpenApiConfig config) { | ||
config.setAlphanumericOnlyRefs(true); | ||
config.setDisableDefaultValues(true); | ||
config.setDisableIntegerFormat(true); | ||
config.setDisableFeatures(SetUtils.of("default")); | ||
} | ||
}, | ||
DISABLED("disabled") { | ||
@Override | ||
public void setDefaults(OpenApiConfig config) { | ||
} | ||
}; | ||
|
||
private final String version; | ||
|
||
ApiGatewayDefault(String version) { | ||
this.version = version; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return version; | ||
} | ||
|
||
@SmithyUnstableApi | ||
public abstract void setDefaults(OpenApiConfig config); | ||
} |
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
7 changes: 0 additions & 7 deletions
7
.../java/software/amazon/smithy/aws/apigateway/openapi/AddDefaultRestConfigSettingsTest.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
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
43 changes: 0 additions & 43 deletions
43
...i/src/test/resources/software/amazon/smithy/aws/apigateway/openapi/alphanumeric-only.json
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
Oops, something went wrong.