private void populate(ObjectNode node, SchemaProperty propertyAnnotation, SchemaGenerationContext context) {
            // mark reference property as required
            node.withArray(context.getKeyword(SchemaKeyword.TAG_REQUIRED)).add(propertyAnnotation.name());
            // check additional requirement
            ObjectNode propertyNode = this.withObject(
                    this.withObject(node, context.getKeyword(SchemaKeyword.TAG_PROPERTIES)),
                    propertyAnnotation.name());
            if (!Objects.equals(propertyAnnotation.constValue(), "")) {
                propertyNode.put(context.getKeyword(SchemaKeyword.TAG_CONST), propertyAnnotation.constValue());
            } else if (!Objects.equals(propertyAnnotation.pattern(), "")) {
                propertyNode.put(context.getKeyword(SchemaKeyword.TAG_PATTERN), propertyAnnotation.pattern());
            }
        }
Example created in response to <a href="https://github.com/victools/jsonschema-generator/discussions/328">#328</a>.
<br/>
Creating "if"/"then"/"else" blocks via custom annotations, leveraging the Swagger @Schema annotation.
jsonschema-examples/src/main/java/com/github/victools/jsonschema/examples/IfThenElseExample.java