Class JsonSchema


  • public class JsonSchema
    extends AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
    • Field Detail

      • JSON_SCHEMA_INT_OR_STRING

        public static final io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps JSON_SCHEMA_INT_OR_STRING
    • Constructor Detail

      • JsonSchema

        public JsonSchema()
    • Method Detail

      • from

        public static io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps from​(io.sundr.codegen.model.TypeDef definition,
                                                                                                 String... ignore)
        Creates the JSON schema for the particular TypeDef.
        Parameters:
        definition - The definition.
        ignore - an optional list of property names to ignore
        Returns:
        The schema.
      • newBuilder

        public io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder newBuilder()
        Description copied from class: AbstractJsonSchema
        Creates a new specific builder object.
        Specified by:
        newBuilder in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
        Returns:
        a new builder object specific to the CRD generation version
      • addProperty

        public void addProperty​(io.sundr.codegen.model.Property property,
                                io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder builder,
                                io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps schema)
        Description copied from class: AbstractJsonSchema
        Adds the specified property to the specified builder, calling AbstractJsonSchema.internalFrom(TypeRef) to create the property schema.
        Specified by:
        addProperty in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
        Parameters:
        property - the property to add to the currently being built schema
        builder - the builder representing the schema being built
        schema - the built schema for the property being added
      • build

        public io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps build​(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder builder,
                                                                                           List<String> required)
        Description copied from class: AbstractJsonSchema
        Finishes up the process by actually building the final JSON schema based on the provided builder and a potentially empty list of names of fields which should be marked as required
        Specified by:
        build in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
        Parameters:
        builder - the builder used to build the final schema
        required - the list of names of required fields
        Returns:
        the built JSON schema
      • collectionProperty

        protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps collectionProperty​(io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps schema)
        Description copied from class: AbstractJsonSchema
        Builds the schema for collection properties
        Specified by:
        collectionProperty in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
        Parameters:
        schema - the schema for the extracted element type for this collection-like property
        Returns:
        the schema for the collection-like property
      • singleProperty

        protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps singleProperty​(String typeName)
        Description copied from class: AbstractJsonSchema
        Builds the schema for standard, simple (e.g. string) property types
        Specified by:
        singleProperty in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
        Parameters:
        typeName - the mapped name of the property type
        Returns:
        the schema for the property
      • mappedProperty

        protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps mappedProperty​(io.sundr.codegen.model.TypeRef ref)
        Description copied from class: AbstractJsonSchema
        Builds the schema for specifically handled property types (e.g. intOrString properties)
        Specified by:
        mappedProperty in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>
        Parameters:
        ref - the type of the specifically handled property
        Returns:
        the property schema
      • enumProperty

        protected io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps enumProperty​(com.fasterxml.jackson.databind.JsonNode... enumValues)
        Specified by:
        enumProperty in class AbstractJsonSchema<io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaProps,​io.fabric8.kubernetes.api.model.apiextensions.v1beta1.JSONSchemaPropsBuilder>