Enunciate - How to display media types in the generated REST documents?

StackOverflow https://stackoverflow.com/questions/9100030

  •  21-04-2021
  •  | 
  •  

質問

I have successfully created the documentation for my endpoints using enunciate. This is a sample from the endpoint:

@Produces("application/json")
public class Messages {
  .....
  @DocumentationExample("provide an example")
  @Consumes("application/json")
  @GET
  Message createMessage (Message input) {
    .... store the message, validate, etc. 
  }
  ....
}

The Message is mapped in JAX-WS through Jackson and has this structure:

@XmlRootType
public class Message {
  ..
}

While this works for enunciate, I can't see neither the @Produces, nor @Consumes anywhere in the documentation. Is is possible to 'mark' domain classes somehow else -- not through @XmlRootElement, but through some external configuration file? I'm not keen on changing the domain only for enunciate (even if annotations are concerned).

I also don't see @DocumentationExample annotation (or the value specified as example). Is is possible to provide multiple examples?

Thanks.

役に立ちましたか?

解決

This has since been fixed. The latest Enunciate version is 1.27.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top