阐明 - 如何在生成的 REST 文档中显示媒体类型?
我已使用 enunciate 成功为我的端点创建了文档。这是来自端点的示例:
@Produces("application/json")
public class Messages {
.....
@DocumentationExample("provide an example")
@Consumes("application/json")
@GET
Message createMessage (Message input) {
.... store the message, validate, etc.
}
....
}
Message
通过 Jackson
在 JAX-WS 中映射,并具有以下结构:
@XmlRootType
public class Message {
..
}
虽然这适用于阐明,但我看不到@Produces,也不是文档中任何地方的@Consumes。是否可以通过其他方式“标记”域类——不是通过@XmlRootElement,而是通过一些外部配置文件?我不热衷于仅为了阐明而更改域(即使涉及注释)。
我也没有看到 @DocumentationExample
注释(或作为示例指定的值)。是否可以提供多个示例?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此问题已得到解决。最新的阐明版本是 1.27。
This has since been fixed. The latest Enunciate version is 1.27.