java.lang.Object
software.amazon.smithy.jsonschema.JsonSchemaConfig
software.amazon.smithy.aws.cloudformation.schema.CfnConfig

public final class CfnConfig extends JsonSchemaConfig
"cloudformation" smithy-build plugin configuration settings.
  • Field Details

    • SCHEMA_COMPONENTS_POINTER

      public static final String SCHEMA_COMPONENTS_POINTER
      The JSON pointer to where CloudFormation schema shared resource properties should be written.
      See Also:
  • Constructor Details

    • CfnConfig

      public CfnConfig()
  • Method Details

    • setAlphanumericOnlyRefs

      public void setAlphanumericOnlyRefs(boolean alphanumericOnlyRefs)
      Description copied from class: JsonSchemaConfig
      Creates shape name pointers that strip out non-alphanumeric characters.

      This is necessary for compatibility with some vendors like Amazon API Gateway that only allow alphanumeric shape names.

      Overrides:
      setAlphanumericOnlyRefs in class JsonSchemaConfig
      Parameters:
      alphanumericOnlyRefs - Set to true to strip non-alphanumeric characters.
    • getDisableHandlerPermissionGeneration

      public boolean getDisableHandlerPermissionGeneration()
    • setDisableHandlerPermissionGeneration

      public void setDisableHandlerPermissionGeneration(boolean disableHandlerPermissionGeneration)
      Set to true to disable generating 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.

      Parameters:
      disableHandlerPermissionGeneration - True to disable handler permissions generation
    • getDisableDeprecatedPropertyGeneration

      public boolean getDisableDeprecatedPropertyGeneration()
    • setDisableDeprecatedPropertyGeneration

      public void setDisableDeprecatedPropertyGeneration(boolean disableDeprecatedPropertyGeneration)
      Set to true to disable generating deprecatedProperties for Resource Schemas.

      By default, deprecated members are automatically added to the deprecatedProperties schema property.

      Parameters:
      disableDeprecatedPropertyGeneration - True to disable deprecatedProperties generation, false otherwise.
    • getDisableRequiredPropertyGeneration

      public boolean getDisableRequiredPropertyGeneration()
    • setDisableRequiredPropertyGeneration

      public void setDisableRequiredPropertyGeneration(boolean disableRequiredPropertyGeneration)
      Set to true to disable generating required for Resource Schemas.

      By default, required members are automatically added to the required schema property.

      Parameters:
      disableRequiredPropertyGeneration - True to disable required generation, false otherwise.
    • getDisableCapitalizedProperties

      public boolean getDisableCapitalizedProperties()
    • setDisableCapitalizedProperties

      public void setDisableCapitalizedProperties(boolean disableCapitalizedProperties)
      Set to true to disable automatically capitalizing names of properties of Resource Schemas.

      By default, property names of Resource Schemas are capitalized if no cfnName trait is applied.

      Parameters:
      disableCapitalizedProperties - True to disable capitalizing property names, false otherwise.
    • getExternalDocs

      public List<String> getExternalDocs()
    • setExternalDocs

      public void setExternalDocs(List<String> externalDocs)
      Limits the source of converted "externalDocs" fields to the specified priority ordered list of names in an externalDocumentation trait.

      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".

      Parameters:
      externalDocs - External docs to look for and convert, in order.
    • getJsonAdd

      public Map<ShapeId,Map<String,Node>> getJsonAdd()
    • setJsonAdd

      public void setJsonAdd(Map<ShapeId,Map<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.

      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.

      Parameters:
      jsonAdd - Map of JSON path to values to patch in.
    • setUseJsonName

      public void setUseJsonName(boolean useJsonName)
      Description copied from class: JsonSchemaConfig
      Uses the value of the jsonName trait when creating JSON schema properties for structure and union shapes.

      This property has no effect if a PropertyNamingStrategy is manually configured on a JsonSchemaConverter.

      Overrides:
      setUseJsonName in class JsonSchemaConfig
      Parameters:
      useJsonName - Set to true to use jsonName traits when creating refs..
    • setMapStrategy

      public void setMapStrategy(JsonSchemaConfig.MapStrategy mapStrategy)
      Description copied from class: JsonSchemaConfig
      Configures how Smithy map shapes are converted to JSON Schema.
      Overrides:
      setMapStrategy in class JsonSchemaConfig
      Parameters:
      mapStrategy - The map strategy to use.
    • getOrganizationName

      public String getOrganizationName()
    • setOrganizationName

      public void setOrganizationName(String organizationName)
      Sets the "Organization" component for each of the generated resource's type name.

      This value defaults to "AWS" if the aws.api#service trait is present. Otherwise, the value is required configuration.

      Parameters:
      organizationName - Name to use for the "Organization" component of resource type names.
      See Also:
    • getServiceName

      public String getServiceName()
    • setServiceName

      public void setServiceName(String serviceName)
      Sets the "Service" component for each of the generated resource's type name.

      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.

      Parameters:
      serviceName - Name to use for the "Service" component of resource type names.
      See Also:
    • getSourceDocs

      public List<String> getSourceDocs()
    • setSourceDocs

      public void setSourceDocs(List<String> sourceDocs)
      Limits the source of converted "sourceDocs" fields to the specified priority ordered list of names in an externalDocumentation trait.

      This list is case insensitive. By default, this is a list of the following values: "Source Url", "SourceUrl", "Source", and "Source Code".

      Parameters:
      sourceDocs - Source docs to look for and convert, in order.
    • setUnionStrategy

      public void setUnionStrategy(JsonSchemaConfig.UnionStrategy unionStrategy)
      Description copied from class: JsonSchemaConfig
      Configures how Smithy union shapes are converted to JSON Schema.
      Overrides:
      setUnionStrategy in class JsonSchemaConfig
      Parameters:
      unionStrategy - The union strategy to use.
    • fromNode

      public static CfnConfig fromNode(Node settings)
      Creates a CfnConfig from a Node value.

      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.

      Parameters:
      settings - Input to deserialize.
      Returns:
      Returns the deserialized