public boolean definesProperty()

in src/main/java/software/amazon/cloudformation/resource/ResourceTypeSchema.java [280:296]


    public boolean definesProperty(String field) {
        // when schema contains combining properties
        // (keywords for combining schemas together, with options being "oneOf", "anyOf", and "allOf"),
        // schema will be a CombinedSchema with
        // - an allOf criterion
        // - subschemas
        // - an ObjectSchema that contains properties to be checked
        // - other CombinedSchemas corresponding to the usages of combining properties.
        // These CombinedSchemas should be ignored. Otherwise, JSON schema's definesProperty method
        // will search for field as a property in the CombinedSchema, which is not desired.
        Schema schemaToCheck = schema instanceof CombinedSchema
            ? ((CombinedSchema) schema).getSubschemas().stream()
                .filter(subschema -> subschema instanceof ObjectSchema)
                .findFirst().get()
            : schema;
        return schemaToCheck.definesProperty(field);
    }