Class TemplateUtil

java.lang.Object
nl.datasteel.crudcraft.codegen.writer.TemplateUtil

public final class TemplateUtil extends Object
Utility helpers for common annotation templates used by writers.
  • Method Details

    • schema

      public static com.squareup.javapoet.AnnotationSpec schema(String desc)
      Generates an OpenAPI Schema annotation with a description.
      Parameters:
      desc - the description to include in the Schema annotation
      Returns:
      an AnnotationSpec for the Schema annotation with the given description
    • schemaAllowable

      public static com.squareup.javapoet.AnnotationSpec schemaAllowable(List<String> values)
      Generates an OpenAPI Schema annotation with a list of allowable values. The values are formatted as a comma-separated string enclosed in quotes.
      Parameters:
      values - the list of allowable values
      Returns:
      an AnnotationSpec for the Schema annotation with allowable values