Enum value not taken over
See original GitHub issueSwagger core version 1.5.12
The Java enumeration has the following code:
@XmlType(name = "PickPriority")
@XmlEnum
public enum PickPriority {
@XmlEnumValue("1")
VALUE_1("1"),
The following code is being generated:
{"name":"PickingPriority"},"enum":["VALUE_1",
The value() of the enumeration should be used.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
c++ - Is it allowed for an enum to have an unlisted value?
Now a very tricky thing: the values that can be held by an enum variable depends on whether or not the underlying type...
Read more >Enum With and Without Values - Learn TypeScript - Educative.io
enum is a type that enforces a limited and defined group of constants. enum must have a name and accepted values. Afterward, you...
Read more >Enumeration types - C# reference - Microsoft Learn
An enumeration type (or enum type) is a value type defined by a set of named constants of the underlying integral numeric type....
Read more >Attaching Values to Java Enum - Baeldung
Java provides a valueOf(String) method for all enum types. Thus, we can always get an enum value based on the declared name: assertSame(Element....
Read more >Enum Types - Java™ Tutorials
An enum type is a special data type that enables for a variable to be a set of predefined constants. The variable must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wrote a custom ObjectMapper but the getContext is never called when refreshing from SwaggerUI. The constructor is called during startup. Any idea’s?
`import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provider;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
@Provider public class EnumObjectMapperProvider implements ContextResolver<ObjectMapper> {
I’ve been adding authentication to my API, and came across an issue with my
SwaggerBootstrapper
class given above, namely, the enums that are inside swagger-core aren’t serialized correctly.The enums inside swagger-core (e.g.,
io.swagger.models.auth.In
) are specified using Jackson annotations, and my originalSwaggerBootstrapper
doesn’t respect those Jackson annotations.So you get
in": "HEADER"
instead ofin": "header"
in your swagger.json.Please use this version instead: