Hello at all,

I have a *swagger.yaml* where I also define some enums, like this:

type: object
    properties:
      id:
        type: integer
      status:
        type: string
        enum:
          - started
          - finished


With that definiiton I generate server code for JAX RS and the Swagger enum 
is generated as a Java enum:

public enum StatusEnum {
    STARTED("started"),
    FINISHED("finished")

    private String value;

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

    @Override
    public String toString() {
        return String.valueOf(value);
    }
}


But when I use such an enum the field *status* in the response object is 
always null. What is the problem? Do I have to "configure" something that 
Swagger/JAX RS knows what to do with the enum value? Why it is not done by 
the generator?

I have also another question which could be the same. During generation I 
use the option *--type-mappings Date=MyDate*. How Swagger/JAX RS knows how 
to handle *MyDate*? In the generated code I can't find anything about it. 
Only in the generated api and model classes there is *MyDate* instaed of 
*Date*. But that's it. And it does not work also.

Kind regards.

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to