public final class CfnConfig extends JsonSchemaConfig
JsonSchemaConfig.MapStrategy, JsonSchemaConfig.UnionStrategy
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCHEMA_COMPONENTS_POINTER
The JSON pointer to where CloudFormation schema shared resource properties should be written.
|
Constructor and Description |
---|
CfnConfig() |
Modifier and Type | Method and Description |
---|---|
static CfnConfig |
fromNode(Node settings)
Creates a CfnConfig from a Node value.
|
boolean |
getDisableCapitalizedProperties() |
boolean |
getDisableDeprecatedPropertyGeneration() |
boolean |
getDisableHandlerPermissionGeneration() |
boolean |
getDisableRequiredPropertyGeneration() |
java.util.List<java.lang.String> |
getExternalDocs() |
java.util.Map<ShapeId,java.util.Map<java.lang.String,Node>> |
getJsonAdd() |
java.lang.String |
getOrganizationName() |
java.lang.String |
getServiceName() |
java.util.List<java.lang.String> |
getSourceDocs() |
void |
setAlphanumericOnlyRefs(boolean alphanumericOnlyRefs)
Creates shape name pointers that strip out non-alphanumeric characters.
|
void |
setDisableCapitalizedProperties(boolean disableCapitalizedProperties)
Set to true to disable automatically capitalizing names of properties
of Resource Schemas.
|
void |
setDisableDeprecatedPropertyGeneration(boolean disableDeprecatedPropertyGeneration)
Set to true to disable generating
deprecatedProperties for Resource Schemas. |
void |
setDisableHandlerPermissionGeneration(boolean disableHandlerPermissionGeneration)
Set to true to disable generating
handler property's permissions
lists for Resource Schemas. |
void |
setDisableRequiredPropertyGeneration(boolean disableRequiredPropertyGeneration)
Set to true to disable generating
required for Resource Schemas. |
void |
setExternalDocs(java.util.List<java.lang.String> externalDocs)
Limits the source of converted "externalDocs" fields to the specified
priority ordered list of names in an externalDocumentation trait.
|
void |
setJsonAdd(java.util.Map<ShapeId,java.util.Map<java.lang.String,Node>> jsonAdd)
Adds or replaces the JSON value in the generated resource schema
document at the given JSON pointer locations with a different JSON
value.
|
void |
setMapStrategy(JsonSchemaConfig.MapStrategy mapStrategy)
Configures how Smithy map shapes are converted to JSON Schema.
|
void |
setOrganizationName(java.lang.String organizationName)
Sets the "Organization" component for each of the generated resource's
type name.
|
void |
setServiceName(java.lang.String serviceName)
Sets the "Service" component for each of the generated resource's
type name.
|
void |
setSourceDocs(java.util.List<java.lang.String> sourceDocs)
Limits the source of converted "sourceDocs" fields to the specified
priority ordered list of names in an externalDocumentation trait.
|
void |
setUnionStrategy(JsonSchemaConfig.UnionStrategy unionStrategy)
Configures how Smithy union shapes are converted to JSON Schema.
|
void |
setUseJsonName(boolean useJsonName)
Uses the value of the jsonName trait when creating JSON schema
properties for structure and union shapes.
|
detectJsonTimestampFormat, getAlphanumericOnlyRefs, getDefaultTimestampFormat, getDefinitionPointer, getDisableFeatures, getExtensions, getExtensions, getMapStrategy, getSchemaDocumentExtensions, getService, getSupportNonNumericFloats, getUnionStrategy, getUseJsonName, isEnableOutOfServiceReferences, putExtension, putExtension, putExtension, putExtensions, setDefaultTimestampFormat, setDefinitionPointer, setDisableFeatures, setEnableOutOfServiceReferences, setExtensions, setSchemaDocumentExtensions, setService, setSupportNonNumericFloats
public static final java.lang.String SCHEMA_COMPONENTS_POINTER
public void setAlphanumericOnlyRefs(boolean alphanumericOnlyRefs)
JsonSchemaConfig
This is necessary for compatibility with some vendors like Amazon API Gateway that only allow alphanumeric shape names.
setAlphanumericOnlyRefs
in class JsonSchemaConfig
alphanumericOnlyRefs
- Set to true to strip non-alphanumeric characters.public boolean getDisableHandlerPermissionGeneration()
public void setDisableHandlerPermissionGeneration(boolean disableHandlerPermissionGeneration)
handler
property's permissions
lists for Resource Schemas.
By default, handler permissions are automatically added to the handler
property's permissions
list. This includes the lifecycle operation used
and any permissions listed in the aws.iam#requiredActions
trait.
disableHandlerPermissionGeneration
- True to disable handler permissions
generationpublic boolean getDisableDeprecatedPropertyGeneration()
public void setDisableDeprecatedPropertyGeneration(boolean disableDeprecatedPropertyGeneration)
deprecatedProperties
for Resource Schemas.
By default, deprecated members are automatically added to the
deprecatedProperties
schema property.
disableDeprecatedPropertyGeneration
- True to disable deprecatedProperties
generation, false otherwise.public boolean getDisableRequiredPropertyGeneration()
public void setDisableRequiredPropertyGeneration(boolean disableRequiredPropertyGeneration)
required
for Resource Schemas.
By default, required members are automatically added to the
required
schema property.
disableRequiredPropertyGeneration
- True to disable required
generation, false otherwise.public boolean getDisableCapitalizedProperties()
public void setDisableCapitalizedProperties(boolean disableCapitalizedProperties)
By default, property names of Resource Schemas are capitalized if
no cfnName
trait is applied.
disableCapitalizedProperties
- True to disable capitalizing property names,
false otherwise.public java.util.List<java.lang.String> getExternalDocs()
public void setExternalDocs(java.util.List<java.lang.String> externalDocs)
This list is case insensitive. By default, this is a list of the following values: "Documentation Url", "DocumentationUrl", "API Reference", "User Guide", "Developer Guide", "Reference", and "Guide".
externalDocs
- External docs to look for and convert, in order.public void setJsonAdd(java.util.Map<ShapeId,java.util.Map<java.lang.String,Node>> jsonAdd)
The value must be a map where each key is a resource shape ID. The value is a map where each key is a valid JSON pointer string as defined in RFC 6901. Each value in the nested map is the JSON value to add or replace at the given target.
Values are added using similar semantics of the "add" operation of JSON Patch, as specified in RFC 6902, with the exception that adding properties to an undefined object will create nested objects in the result as needed.
jsonAdd
- Map of JSON path to values to patch in.public void setUseJsonName(boolean useJsonName)
JsonSchemaConfig
This property has no effect if a PropertyNamingStrategy
is
manually configured on a JsonSchemaConverter
.
setUseJsonName
in class JsonSchemaConfig
useJsonName
- Set to true to use jsonName traits when creating refs..public void setMapStrategy(JsonSchemaConfig.MapStrategy mapStrategy)
JsonSchemaConfig
setMapStrategy
in class JsonSchemaConfig
mapStrategy
- The map strategy to use.public java.lang.String getOrganizationName()
public void setOrganizationName(java.lang.String organizationName)
This value defaults to "AWS" if the aws.api#service
trait is
present. Otherwise, the value is required configuration.
organizationName
- Name to use for the "Organization" component of resource type names.public java.lang.String getServiceName()
public void setServiceName(java.lang.String serviceName)
This value defaults to the value of the aws.api#service/cloudFormationName
if the trait is present. Otherwise, the value defaults to the shape name of the
specified service shape.
serviceName
- Name to use for the "Service" component of resource type names.public java.util.List<java.lang.String> getSourceDocs()
public void setSourceDocs(java.util.List<java.lang.String> sourceDocs)
This list is case insensitive. By default, this is a list of the following values: "Source Url", "SourceUrl", "Source", and "Source Code".
sourceDocs
- Source docs to look for and convert, in order.public void setUnionStrategy(JsonSchemaConfig.UnionStrategy unionStrategy)
JsonSchemaConfig
setUnionStrategy
in class JsonSchemaConfig
unionStrategy
- The union strategy to use.public static CfnConfig fromNode(Node settings)
This method uses the NodeMapper
on the converted input object.
Note that this class can be deserialized using a NodeMapper too since the
NodeMapper will look for a static, public, fromNode method.
This method also serializes unknown properties into the "extensions" map so that they are accessible to CfnMapper implementations.
settings
- Input to deserialize.