-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid swagger specification 2.0? #59
Comments
Additional validation issues with:
|
@tomcruise81 - We will take a look and update |
Just to keep you updated, the issue is being worked upon |
@tomcruise81 - A fix has been provided. Can you check and update? |
I'm still getting validation errors on those same spec files. However, the validation errors are now different. For example, for https://github.com/SoftwareAG/webmethods-api-gateway/blob/master/apigatewayservices/APIGatewayServiceManagement.json, I now get the following output:
Looking at the spec file for entries where it's indicated that there are "duplicate properties", I can see things like: "GraphQLAPI" : {
"allOf" : [ {
"$ref" : "#/definitions/API"
}, {
"type" : "object",
"properties" : {
"apiTags" : {
"type" : "array",
"description" : "A list of API level tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier",
"items" : {
"type" : "string"
}
},
"nativeEndpoints" : {
"type" : "array",
"description" : "Native endpoints",
"items" : {
"$ref" : "#/definitions/NativeEndpoint"
}
},
"sdlDefinitions" : {
"$ref" : "#/definitions/GqlSDLDefinitions"
},
"serviceRegistryDisplayName" : {
"type" : "string",
"description" : "The name of the API in service registry when the API is published to a service registry."
},
"tags" : {
"type" : "array",
"description" : "A list of tags with additional metadata",
"items" : {
"$ref" : "#/definitions/Tag"
}
}
}
} ]
} But the "definitions" : {
"API" : {
"type" : "object",
"discriminator" : "type",
"properties" : {
"apiTags" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"description" : {
"type" : "string"
},
"serviceRegistryDisplayName" : {
"type" : "string"
},
"tags" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Tag"
}
},
"title" : {
"type" : "string"
},
"type" : {
"type" : "string"
},
"uri" : {
"type" : "array",
"uniqueItems" : true,
"items" : {
"type" : "string"
}
},
"version" : {
"type" : "string"
}
}
}, which I'm guessing is why the validation is still complaining. |
I'm using go-swagger. You can use their CLI to validate the spec files - https://github.com/go-swagger/go-swagger#validate-a-specification |
HI @tomcruise81 , Please check the swagger against https://editor.swagger.io/. We are validating the swagger against this endpoint only.
|
If you're going against SmartBear's implementation, I can as well. I've used Swagger Codegen, which doesn't appear to be doing validation of the spec, and am still having a multitude of problems:
"paths": {
"/apis": {
"get": {
"description": "Get all APIs or subset of APIs",
"operationId": "getAPIs",
"produces": [
"application/json"
],
"parameters": [
...
],
"responses": {
"200": {
"description": "Returns the list of all APIs",
"examples": ...,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/APIResponseGetAPIs"
}
}
}, "APIResponseGetAPIs" : {
"type" : "object",
"properties" : {
"active" : {
"type" : "boolean"
},
"apiId" : {
"type" : "string"
},
"apiName" : {
"type" : "string",
"description" : "API Name"
},
"apiVersion" : {
"type" : "string",
"description" : "API Version"
},
"errorReason" : {
"type" : "string"
},
"id" : {
"type" : "string",
"description" : "API Id"
},
"publishedPortals" : {
"type" : "array",
"description" : "Published portals of an API",
"items" : {
"type" : "string"
}
},
"responseStatus" : {
"type" : "string",
"enum" : [ "SUCCESS", "ERROR", "NOT_FOUND", "BAD_REQUEST", "PARTIAL_SUCCESS" ]
},
"systemVersion" : {
"type" : "integer",
"format" : "int32",
"description" : "System version of an API"
},
"teams" : {
"type" : "array",
"description" : "Contains teams belonging to an API.",
"items" : {
"$ref" : "#/definitions/Team"
}
},
"type" : {
"type" : "string",
"description" : "API Type"
}
},
"description" : "This model contains the basics details of an API."
}, Based on the spec, the response should be something like: {
"apiResponse": [
{
"apiName": ...,
"apiVersion": ..., However, the actual response for a call to this endpoint is something like (note the extra layer of nesting): {
"apiResponse": [
{
"api": {
"apiName": ...,
"apiVersion": ..., That's as far as I've gotten while trying to utilize the spec files so there very well could be other inconsistencies between the spec and what the the APIs are actually doing. |
Actually, based on the spec, the expectation is something more in line with (i.e. it's missing two layers of nesting): [{
"apiName": ...,
"apiVersion": ..., |
@tomcruise81 - Can you please check the latest fix? |
Sorry that it took me a bit. Still seeing a number of issues in the APIs that I've tested. APIGatewayAdministration.json
APIGatewayPolicyManagement.json
APIGatewaySearch.json
APIGatewayServiceManagement.json
Please note that this is in NOT intended to be a comprehensive list of the issues in the API specs, but rather just some of the issues that I've come across in my testing. |
Utilizing the swagger specs available at https://github.com/SoftwareAG/webmethods-api-gateway/tree/master/apigatewayservices, I'm trying to generate a Golang client via https://github.com/go-swagger/go-swagger
For https://github.com/SoftwareAG/webmethods-api-gateway/blob/master/apigatewayservices/APIGatewayServiceManagement.json, I get the following output:
Similarly for https://github.com/SoftwareAG/webmethods-api-gateway/blob/master/apigatewayservices/APIGatewayUserManagementSwagger.json, I get the following output:
The text was updated successfully, but these errors were encountered: