Closed jtorres-viavansi closed 8 years ago
This may be a valid JSON, but it's not a valid Swagger spec. Haven't looked into all issues, but:
host
value is invalid.info
value is missing required properties (title
).basic
for security, but it's not defined anywhere.How are you generating the spec? You should run it through a validator to make sure it's valid.
Hi, it's generated using annotations in Java classes and starting swagger as servlet. As I say if I comment /verify/ methods it generates right, however it can't generate when I uncomment then. There is no console or javascript error, If I examine traffic in firefox the petition is completed correctly.
Thanks.
More info, I've located the problem. I've validated generated JSON against Swagger API 2.0 and it's valid, however the problem is the definitios sections. In the verify methods it's used a object of type "VerifierOidDTO", a JAva class as follows:
public class VerifierOidDTO implements Serializable{
private static final long serialVersionUID = 1L;
private String oid;
private String description;
private List<String> values;
private List<VerifierOidDTO> childOids;
private boolean objectIdentifier;
However Swagger generates a incomplete definition type:
"VerifierOidDTO" : {
"type" : "object",
"properties" : {
"oid" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"values" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"childOids" : {
"type" : "array"
},
"objectIdentifier" : {
"type" : "boolean",
"default" : false
}
}
},
childOids is not correctly generated, it should be as follows:
"VerifierOidDTO" : {
"type" : "object",
"properties" : {
"oid" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"values" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"childOids" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/VerifierOidDTO"
}
},
"objectIdentifier" : {
"type" : "boolean",
"default" : false
}
}
},
It seems that Swagger has a bug when trying to generate a $ref to itself definition, maybe?
Thanks.
Got it, I've updated swagger-jersey2-jaxrs version and it works.
Hello, I'm trying to generate swagger-ui from the following swagger.json but it freezes and don't generate:
JSON is valid. The problem occurs with /verify methods, if I comment this section on my API REST it generates correctly. I'm using lastest swagger-ui, this is 2.1.4.
Thanks for your support.