swagger参数是json返回值类型类型的怎么标记哪些是必须的

Latest Posts
八月 27th, 2015常用到的注解有:
ApiModelProperty
ApiOperation
ApiResponse
ApiResponses
ResponseHeader
1. api标记
Api 用在类上,说明该类的作用。可以标记一个Controller类做为swagger 文档资源,使用方式:
@Api(value = "/user", description = "Operations about user")
与Controller注解并列使用。 属性配置:
属性名称备注
url的路径值
如果设置这个值、value的值会被覆盖
description
对api资源的描述
基本路径可以不配置
如果配置多个Api 想改变显示的顺序位置
For example, "application/json, application/xml"
For example, "application/json, application/xml"
Possible values: http, https, ws, wss.
authorizations
高级特性认证时配置
配置为true 将在文档中隐藏
在SpringMvc中的配置如下:
@Controller
@RequestMapping(value = "/api/pet", produces = {APPLICATION_JSON_VALUE, APPLICATION_XML_VALUE})
@Api(value = "/pet", description = "Operations about pets")
public class PetController {
2. ApiOperation标记
ApiOperation:用在方法上,说明方法的作用,每一个url资源的定义,使用方式:
@ApiOperation(
value = "Find purchase order by ID",
notes = "For valid response try integer IDs with value &= 5 or & 10. Other values will generated exceptions",
response = Order,
tags = {"Pet Store"})
与Controller中的方法并列使用。
属性配置:
属性名称备注
url的路径值
如果设置这个值、value的值会被覆盖
description
对api资源的描述
基本路径可以不配置
如果配置多个Api 想改变显示的顺序位置
For example, "application/json, application/xml"
For example, "application/json, application/xml"
Possible values: http, https, ws, wss.
authorizations
高级特性认证时配置
配置为true 将在文档中隐藏
返回的对象
responseContainer
这些对象是有效的 "List", "Set" or "Map".,其他无效
httpMethod
"GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS" and "PATCH"
http的状态码 默认 200
extensions
在SpringMvc中的配置如下:
@RequestMapping(value = "/order/{orderId}", method = GET)
@ApiOperation(
value = "Find purchase order by ID",
notes = "For valid response try integer IDs with value &= 5 or & 10. Other values will generated exceptions",
response = Order.class,
tags = { "Pet Store" })
public ResponseEntity&Order& getOrderById(@PathVariable("orderId") String orderId)
throws NotFoundException {
Order order = storeData.get(Long.valueOf(orderId));
if (null != order) {
return ok(order);
throw new NotFoundException(404, "Order not found");
3. ApiParam标记
ApiParam请求属性,使用方式:
public ResponseEntity&User& createUser(@RequestBody @ApiParam(value = "Created user object", required = true)
User user)
与Controller中的方法并列使用。
属性配置:
属性名称备注
defaultValue
默认属性值
allowableValues
可以不配置
是否属性必填
不过多描述
allowMultiple
默认为false
隐藏该属性
在SpringMvc中的配置如下:
public ResponseEntity&Order& getOrderById(
@ApiParam(value = "ID of pet that needs to be fetched", allowableValues = "range[1,5]", required = true)
@PathVariable("orderId") String orderId)
4. ApiResponse
ApiResponse:响应配置,使用方式:
@ApiResponse(code = 400, message = "Invalid user supplied")
与Controller中的方法并列使用。 属性配置:
属性名称备注
http的状态码
默认响应类 Void
参考ApiOperation中配置
responseHeaders
参考 ResponseHeader 属性配置说明
responseContainer
参考ApiOperation中配置
在SpringMvc中的配置如下:
@RequestMapping(value = "/order", method = POST)
@ApiOperation(value = "Place an order for a pet", response = Order.class)
@ApiResponses({ @ApiResponse(code = 400, message = "Invalid Order") })
public ResponseEntity&String& placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) Order order) {
storeData.add(order);
return ok("");
5. ApiResponses
ApiResponses:响应集配置,使用方式:
@ApiResponses({ @ApiResponse(code = 400, message = "Invalid Order") })
与Controller中的方法并列使用。 属性配置:
属性名称备注
多个ApiResponse配置
在SpringMvc中的配置如下:
@RequestMapping(value = "/order", method = POST)
@ApiOperation(value = "Place an order for a pet", response = Order.class)
@ApiResponses({ @ApiResponse(code = 400, message = "Invalid Order") })
public ResponseEntity&String& placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) Order order) {
storeData.add(order);
return ok("");
6. ResponseHeader
响应头设置,使用方法
@ResponseHeader(name="head1",description="response head conf")
与Controller中的方法并列使用。 属性配置:
属性名称备注
响应头名称
description
默认响应类 Void
responseContainer
参考ApiOperation中配置
在SpringMvc中的配置如下:
@ApiModel(description = "群组")
@ApiImplicitParams:用在方法上包含一组参数说明;
@ApiImplicitParam:用在@ApiImplicitParams注解中,指定一个请求参数的各个方面
paramType:参数放在哪个地方
name:参数代表的含义
value:参数名称
dataType: 参数类型,有String/int,无用
required : 是否必要
defaultValue:参数的默认值
@ApiResponses:用于表示一组响应;
@ApiResponse:用在@ApiResponses中,一般用于表达一个错误的响应信息;
code: 响应码(int型),可自定义
message:状态码对应的响应信息
@ApiModel:描述一个Model的信息(这种一般用在post创建的时候,使用@RequestBody这样的场景,请求参数无法使用@ApiImplicitParam注解进行描述的时候;
@ApiModelProperty:描述一个model的属性。
作者:Xiangdong_She链接:https://www.jianshu.com/p/12f來源:简书著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
阅读(...) 评论()swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALID iconwith no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid, right?How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--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 swagger-swaggersocket+.For more options, visit
Search Discussions
update: I found the debug option of the validator and got the followingfrom that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALID iconwith no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid, right?How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--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 swagger-swaggersocket+.For more options, visit
The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and which implementationyou use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell wrote:update: I found the debug option of the validator and got the followingfrom that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALID iconwith no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid, right?How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--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 anemail to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&, response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&)@ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-ui version2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and which implementationyou use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&javascript:&& wrote:update: I found the debug option of the validator and got the followingfrom that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALID iconwith no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid, right?How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--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 anemail to swagger-swaggersocket+ &javascript:&.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Looks like you've hit a bug. Please open an issue on swagger-core about it,with the method signature as you pasted here (that would help whoever isgoing to fix it).Would help if you link to this thread *as well* for further information.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-ui version2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and which implementationyou use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got the followingfrom that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALID iconwith no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
I entered Any ideas for a workaround until this is fixed? Would hidden=true for theseendpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-core aboutit, with the method signature as you pasted here (that would help whoeveris going to fix it).Would help if you link to this thread *as well* for further information.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&javascript:&& wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-ui version2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and which implementationyou use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got the followingfrom that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALIDicon with no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+ &javascript:&.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Yeah, hiding the endpoints would solve it for now. You just brought to myattention that we're missing another feature, I'll open a ticket for thatone.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-core aboutit, with the method signature as you pasted here (that would help whoeveris going to fix it).Would help if you link to this thread *as well* for further information.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-ui version2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALIDicon with no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem, andsuggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does not display theapi and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in the validator, orthe json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the new json(which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just brought to myattention that we're missing another feature, I'll open a ticket for thatone.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell &ssch...@jibe.com&javascript:&& wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-core aboutit, with the method signature as you pasted here (that would help whoeveris going to fix it).Would help if you link to this thread *as well* for further information.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-ui version2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALIDicon with no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem,and suggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+ &javascript:&.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
If you can share it, that would be great.On Mon, Jun 22, 2015 at 5:03 PM, Steven Schwell wrote:Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does not displaythe api and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in the validator,or the json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the new json(which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just brought to myattention that we're missing another feature, I'll open a ticket for thatone.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-core aboutit, with the method signature as you pasted here (that would help whoeveris going to fix it).Would help if you link to this thread *as well* for furtherinformation.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-ui version2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALIDicon with no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem,and suggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Here ya go. This json passes validation, but fails to load in the ui.Thanks agains.On Monday, June 22, 2015 at 10:08:08 AM UTC-4, Ron wrote:If you can share it, that would be great.On Mon, Jun 22, 2015 at 5:03 PM, Steven Schwell &ssch...@jibe.com&javascript:&& wrote:Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does not displaythe api and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in the validator,or the json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the new json(which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just brought tomy attention that we're missing another feature, I'll open a ticket forthat one.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell &ssch...@jibe.com&wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-coreabout it, with the method signature as you pasted here (that would helpwhoever is going to fix it).Would help if you link to this thread *as well* for furtherinformation.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-uiversion 2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be able topinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orange INVALIDicon with no explanation of what is invalid. Pretty useless validator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem,and suggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+ &javascript:&.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Several models properties are not generated properly. These are:&&&&1. QuestionValue.questions&&&&2. UserValue.documents&&&&3. LoggerContext.loggerList &-- not sure this model is meant to be&&&&documented at all&&&&4. JobApplicationValue.answers&&&&5. JobApplicationValue.documentsOn top of that, unfortunately, you've hitFor the list above, can you share your model classes so we can try andtrack down the issue?On Mon, Jun 22, 2015 at 5:20 PM, Steven Schwell wrote:Here ya go. This json passes validation, but fails to load in the ui.Thanks agains.On Monday, June 22, 2015 at 10:08:08 AM UTC-4, Ron wrote:If you can share it, that would be great.On Mon, Jun 22, 2015 at 5:03 PM, Steven Schwell wrote:Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does not displaythe api and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in the validator,or the json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the new json(which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just brought tomy attention that we're missing another feature, I'll open a ticket forthat one.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell &ssch...@jibe.com&wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-coreabout it, with the method signature as you pasted here (that would helpwhoever is going to fix it).Would help if you link to this thread *as well* for furtherinformation.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-uiversion 2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be ableto pinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.com&wrote:update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwell wrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orangeINVALID icon with no explanation of what is invalid. Pretty uselessvalidator.I do see an array type in the json with no items. That's invalid,right? How would that be fixed? I guess with some annotation somewhere?Attached is our swagger.json. Maybe someone can spot the problem,and suggest a fix.Thanks,s.--You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email toswagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Ron, my colleague Dave will get you those model classes.I'm wondering why this json passed validation if it is invalid?Also, it is curious that this model worked fine with previous version ofswagger.Thankss.On Monday, June 22, 2015 at 11:01:11 AM UTC-4, Ron wrote:Several models properties are not generated properly. These are:1. QuestionValue.questions2. UserValue.documents3. LoggerContext.loggerList &-- not sure this model is meant to bedocumented at all4. JobApplicationValue.answers5. JobApplicationValue.documentsOn top of that, unfortunately, you've hitFor the list above, can you share your model classes so we can try andtrack down the issue?On Mon, Jun 22, 2015 at 5:20 PM, Steven Schwell &ssch...@jibe.com&javascript:&& wrote:Here ya go. This json passes validation, but fails to load in the ui.Thanks agains.On Monday, June 22, 2015 at 10:08:08 AM UTC-4, Ron wrote:If you can share it, that would be great.On Mon, Jun 22, 2015 at 5:03 PM, Steven Schwell &ssch...@jibe.com&wrote:Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does not displaythe api and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in thevalidator, or the json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the newjson (which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just brought tomy attention that we're missing another feature, I'll open a ticket forthat one.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell &ssch...@jibe.com&wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-coreabout it, with the method signature as you pasted here (that would helpwhoever is going to fix it).Would help if you link to this thread *as well* for furtherinformation.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-uiversion 2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be ableto pinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.comwrote: update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwellwrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orangeINVALID icon with no explanation of what is invalid. Pretty uselessvalidator.I do see an array type in the json with no items. That'sinvalid, right? How would that be fixed? I guess with some annotationsomewhere?Attached is our swagger.json. Maybe someone can spot theproblem, and suggest a fix.Thanks,s.--You received this message because you are subscribed to theGoogle Groups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email toswagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+ &javascript:&.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Ron, I work with Steven Schwell. Here is a copy of the first class -QuestionValue. Hopefully, this helps.On Monday, June 22, 2015 at 11:01:11 AM UTC-4, Ron wrote:Several models properties are not generated properly. These are:1. QuestionValue.questions2. UserValue.documents3. LoggerContext.loggerList &-- not sure this model is meant to bedocumented at all4. JobApplicationValue.answers5. JobApplicationValue.documentsOn top of that, unfortunately, you've hitFor the list above, can you share your model classes so we can try andtrack down the issue?On Mon, Jun 22, 2015 at 5:20 PM, Steven Schwell &ssch...@jibe.com&javascript:&& wrote:Here ya go. This json passes validation, but fails to load in the ui.Thanks agains.On Monday, June 22, 2015 at 10:08:08 AM UTC-4, Ron wrote:If you can share it, that would be great.On Mon, Jun 22, 2015 at 5:03 PM, Steven Schwell &ssch...@jibe.com&wrote:Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does not displaythe api and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in thevalidator, or the json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the newjson (which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just brought tomy attention that we're missing another feature, I'll open a ticket forthat one.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell &ssch...@jibe.com&wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=true forthese endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-coreabout it, with the method signature as you pasted here (that would helpwhoever is going to fix it).Would help if you link to this thread *as well* for furtherinformation.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) throws ExceptionWe are using swagger-jersey-jaxrs version 1.5.0 and swagger-uiversion 2.1.0 and dropwizard version 0.7.1 (jersey 1.18.1).Thanks again,s.On Friday, June 19, 2015 at 3:49:25 PM UTC-4, Ron wrote:The problem is the the form parameters you have for the POST/questions/document/uploadAttach/user/{userId}/{slug}/{documentName}/{type}.jsonoperation.If you share the method signature with annotations, I may be ableto pinpoint the issue.Also provide which library and version you use, and whichimplementation you use for your REST service.On Fri, Jun 19, 2015 at 10:39 PM, Steven Schwell &ssch...@jibe.comwrote: update: I found the debug option of the validator and got thefollowing from that:[{&level&:&error&,&domain&:&validation&,&keyword&:&oneOf&,&message&:&instancefailed to match exactly one schema (matched 0 out of2)&,&schema&:{&loadingURI&:&http://swagger.io/v2/schema.json#&,&pointer&:&/definitions/parametersList/items&},&instance&:{&pointer&:&/paths/~1questions~1document~1uploadAttach~1user~1{userId}~1{slug}~1{documentName}~1{type}.json/post/parameters/7&}}]Can Anyone interpret this hieroglyphics?What annotation magic is called for?Thanks for any helpOn Friday, June 19, 2015 at 3:10:04 PM UTC-4, Steven Schwellwrote:swagger-ui is not showing our API and devtools shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo I assume our generated swagger.json is invalid in some way.I tried the validator-badge but all it gives is the orangeINVALID icon with no explanation of what is invalid. Pretty uselessvalidator.I do see an array type in the json with no items. That'sinvalid, right? How would that be fixed? I guess with some annotationsomewhere?Attached is our swagger.json. Maybe someone can spot theproblem, and suggest a fix.Thanks,s.--You received this message because you are subscribed to theGoogle Groups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email toswagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it,send an email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------You received this message because you are subscribed to the GoogleGroups &Swagger& group.To unsubscribe from this group and stop receiving emails from it, sendan email to swagger-swaggersocket+.For more options, visit --------------------------------------------------------------------------------------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 anemail to swagger-swaggersocket+ &javascript:&.For more options, visit --------------------------------------------------------------------------------------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 swagger-swaggersocket+.For more options, visit
Yeah, unfortunately this is related to a bug that will be resolved withSteven, as for the validation, unfortunately it is extremely difficult tovalidate the specific use case with JSON Schema alone. I will try toimprove it, but cannot guarantee success there.On Mon, Jun 22, 2015 at 6:36 PM, David Small wrote:Ron, I work with Steven Schwell. Here is a copy of the first class -QuestionValue. Hopefully, this helps.On Monday, June 22, 2015 at 11:01:11 AM UTC-4, Ron wrote:Several models properties are not generated properly. These are:1. QuestionValue.questions2. UserValue.documents3. LoggerContext.loggerList &-- not sure this model is meant to bedocumented at all4. JobApplicationValue.answers5. JobApplicationValue.documentsOn top of that, unfortunately, you've hitFor the list above, can you share your model classes so we can try andtrack down the issue?On Mon, Jun 22, 2015 at 5:20 PM, Steven Schwell wrote:Here ya go. This json passes validation, but fails to load in the ui.Thanks agains.On Monday, June 22, 2015 at 10:08:08 AM UTC-4, Ron wrote:If you can share it, that would be great.On Mon, Jun 22, 2015 at 5:03 PM, Steven Schwell &ssch...@jibe.com&wrote:Hiding the endpoints did produce json that passes the validator. Onemystery solved. Thanks, Ron!However the original problem is still here. swagger-ui does notdisplay the api and devtools still shows:Uncaught TypeError: Cannot read property '$ref' of undefinedSo either the json is still invalid and there is a bug in thevalidator, or the json is valid and there is a bug in the ui.Ron, whats the next step to diagnose? Would you like to see the newjson (which validates properly)?On Monday, June 22, 2015 at 9:29:29 AM UTC-4, Ron wrote:Yeah, hiding the endpoints would solve it for now. You just broughtto my attention that we're missing another feature, I'll open a ticket forthat one.Thanks for opening the bug on the project.On Mon, Jun 22, 2015 at 4:06 PM, Steven Schwell &ssch...@jibe.com&wrote:I entered Any ideas for a workaround until this is fixed? Would hidden=truefor these endpoints produce valid json?Thanks,s.On Sunday, June 21, 2015 at 1:19:05 AM UTC-4, Ron wrote:Looks like you've hit a bug. Please open an issue on swagger-coreabout it, with the method signature as you pasted here (that would helpwhoever is going to fix it).Would help if you link to this thread *as well* for furtherinformation.On Sat, Jun 20, 2015 at 11:36 PM, Steven Schwell &ssch...@jibe.com&wrote:Thanks, Ron, here's the method signature:@POST@Consumes(UTF8MediaType.MULTIPART_FORM_DATA)@Path(&/document/uploadAttachAndParse/user/{userId}/{slug}/{documentName}/{type}.json&)@Timed @UnitOfWork@ApiOperation(value=&uploadAttachAndParseUserDocument&, notes=&Uploads,parses, and attaches the document to the user's job application.&,response=DocumentAndInfo.class, position=509)public DocumentAndInfo uploadAttachAndParseUserDocument(@PathParam(&userId&) @ApiParam(required = true) final String userId,@PathParam(&slug&) final String slug,@PathParam(&type&) String type,@PathParam(&documentName&) final String documentName,@HeaderParam(ClientDAO.HEADER_NAME) final String clientCode,@QueryParam(&uploadToken&) final String uploadToken,@FormDataParam(&document&) final InputStream input,@FormDataParam(&document&) final FormDataContentDisposition detail,@FormDataParam(&document&) final FormDataBodyPart bodyPart,@Context final HttpServletRequest request) thr

我要回帖

更多关于 mysqljson类型 的文章

 

随机推荐