Skip to content

Supported OpenAPI Specification properties

Christopher Molin edited this page Sep 23, 2024 · 7 revisions

The following are OpenAPI Specification properties which are supported. Other properties may be ignored, or may cause problems.

Note

The following properties are referring to the schema definitions, prefixed by components.schemas.{schema}.

Property Description Value Value Description
{schema} Name of the generated Java class. *
{schema}.type Type of the generated Java class. object Generates a Record class.
enum Generates an Enum class.
{schema}.description JavaDoc description of the generated Java class. * If not set, adds the class name as a placeholder in the JavaDoc description.
{schema}.deprecated Marks the generated Java class as Deprecated. true Annotates the class with @Deprecated and adds @deprecated to the JavaDoc description.
false (default) Does nothing.
{schema}.properties Fields of the generated Record class. *
{schema}.properties.{property} Name of the field. * Added as a @param in the JavaDoc.
{schema}.properties.{property}.description Description of the field. * Description of the @param in the JavaDoc. If not set, the class name of the field will be added as a description.
{schema}.properties.{property}.default Default value of the field. * If set, the field is set to the default value if the provided value is null. (Using Objects.requireNonNullElse())
{schema}.properties.{property}.nullable Marks the field with @Nullable-annotations. true Annotates the field with @Nullable.
false (default) Annotates the field with @Nonnull. This will be annotated @Nullable in the constructor, if default has been set.
{schema}.properties.{property}.$ref Type of the field is another Java class. *
{schema}.properties.{property}.type Type of the field. array Generates the field as List<{items.type}>.
boolean Generates the field as Boolean.
enum Not supported yet - See Issue #5
integer Generates the field as Integer.
number Generates the field as BigDecimal.
object Not supported yet - See Issue #4
string Generates the field as String.
Clone this wiki locally