Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import java.net.URI;
{{#jsonb}}
@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class)
@JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class)
{{/jsonb}}
{{/jsonb}}{{^isReleased}}
@Beta{{/isReleased}}
{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
{{#allowableValues}}{{#enumVars}}
{{#enumDescription}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private enum TestCase
ApiMaturity.RELEASED,
false,
true,
8,
9,
Map.of()),
ONE_OF_INTERFACES_ENABLED(
"oneof-interfaces-enabled",
Expand All @@ -83,7 +83,7 @@ private enum TestCase
ApiMaturity.BETA,
true,
true,
9,
10,
Map.of("useOneOfInterfaces", "true", "useOneOfCreators", "true")),
INPUT_SPEC_WITH_BUILDER(
"input-spec-with-builder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ components:
allOf:
- $ref: '#/components/schemas/Cola'
- $ref: '#/components/schemas/Fanta'
ColaTemperature:
enum:
- COOL
- WARM
Cola:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
*/

/*
* Soda Store API
* API for managing sodas in a soda store
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package test;

import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Gets or Sets ColaTemperature
*/

public enum ColaTemperature {

COOL("COOL"),

WARM("WARM");

private final String value;

ColaTemperature(String value) {
this.value = value;
}

/**
* @return The enum value.
*/
@JsonValue
public String getValue() {
return value;
}

/**
* @return The String representation of the enum value.
*/
@Override
@Nonnull public String toString() {
return String.valueOf(value);
}

/**
* Converts the given value to its enum representation.
*
* @param value The input value.
*
* @return The enum representation of the given value.
*/
@JsonCreator
public static ColaTemperature fromValue(@Nonnull final String value) {
for (final ColaTemperature b : ColaTemperature.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ components:
allOf:
- $ref: '#/components/schemas/Cola'
- $ref: '#/components/schemas/Fanta'
ColaTemperature:
enum:
- COOL
- WARM
Cola:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved.
*/

/*
* Soda Store API
* API for managing sodas in a soda store
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package test;

import java.util.Objects;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.google.common.annotations.Beta;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Gets or Sets ColaTemperature
*/

@Beta
public enum ColaTemperature {

COOL("COOL"),

WARM("WARM");

private final String value;

ColaTemperature(String value) {
this.value = value;
}

/**
* @return The enum value.
*/
@JsonValue
public String getValue() {
return value;
}

/**
* @return The String representation of the enum value.
*/
@Override
@Nonnull public String toString() {
return String.valueOf(value);
}

/**
* Converts the given value to its enum representation.
*
* @param value The input value.
*
* @return The enum representation of the given value.
*/
@JsonCreator
public static ColaTemperature fromValue(@Nonnull final String value) {
for (final ColaTemperature b : ColaTemperature.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}

2 changes: 1 addition & 1 deletion release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

### 🐛 Fixed Issues

-
- OpenAPI: When `apiMaturity` is set to `beta`, generated enums will now be `@Beta` annotated.
Loading