On Wednesday, February 15, 2017 at 12:11:39 PM UTC+11, Richard Walker wrote:
>
> Issue #3: values of enumerated types.
>
> (Note: for JSON, the service (via Jackson) returns the values in 
> uppercase, so the JSON Example Value is correct! Confusing, slightly 
> annoying, and something I may want to do something about!)
>

After a bit more experimenting, I was able to get the service itself to 
output JSON with the enum values in lowercase by overriding the default 
JSON serialization with my own ObjectMapper that has JaxbAnnotationModule 
applied. Now that only leaves what Swagger is doing.

I tried the same "trick" as per the example at:

https://github.com/swagger-api/swagger-core/issues/960#issuecomment-173330606

The enum values in the generated swagger.json are still in uppercase.

However, there was _another_ effect: some _but not all_ of the object 
definitions now begin with lowercase. E.g.:

      "vocabulary" : {
         "required" : [
            "related-entity"
         ],
         "xml" : {
            "name" : "vocabulary"
         },
         "type" : "object",
      ...

but:

      "Subject" : {
         "properties" : {
            "source" : {
               "xml" : {
                  "attribute" : true
               },
               "type" : "string"
            },
      ...

The Subject class is defined/generated by xjc as Vocabulary.Subject, i.e. 
it's a static nested class.

-- 
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