Description
The below Swagger doc passes through the SwaggerParser without generating any error messages. The same doc opened in various code editors [including editor.swagger.io] highlights the issue with the lack of object name. In addition, duplicate object names do not seem to be parsed so setting both objects to a name of "" overwrites the first definition with the second silently - "" being a valid string in Java, even if not valid according to the Swagger spec.
Affected Version
1.0.71
Also using SwaggerConvertor and 2.1.22, the converted doc doesn't flag an issue.
Steps to Reproduce
{
"swagger": "2.0",
"info": {
"title": "info_title",
"version": "0/0",
"description": "..",
"contact": {
"name": "contactname",
"url": "contacturl",
"email": "contact@email.com"
}
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"basePath": "/basepath",
"paths": {
"/path": {
"get": {
"summary": "summary",
"responses": {
"200": {
"description": "..",
"schema": {
"type": "object",
"properties": {
"AA": {
"type": "string"
},
"": {
"type": "number"
}
}
}
}
},
"operationId": "getopid",
"description": ".."
}
}
}
}
Expected Behavior
Error messages similar to those from editor.swagger.io:
properties members must be schemasapilint(10037)
properties: object
The value of "properties" MUST be an object. Each value of this object MUST be a valid JSON Schema.
Actual Behavior
Document parsed successfully; attempts to reference the "anonymous" fields cause further processing issues
Environment
- Java version: various
- Build tool: maven
- OS: Fedora 43
Checklist
Description
The below Swagger doc passes through the SwaggerParser without generating any error messages. The same doc opened in various code editors [including editor.swagger.io] highlights the issue with the lack of object name. In addition, duplicate object names do not seem to be parsed so setting both objects to a name of "" overwrites the first definition with the second silently - "" being a valid string in Java, even if not valid according to the Swagger spec.
Affected Version
1.0.71
Also using SwaggerConvertor and 2.1.22, the converted doc doesn't flag an issue.
Steps to Reproduce
Expected Behavior
Error messages similar to those from editor.swagger.io:
Actual Behavior
Document parsed successfully; attempts to reference the "anonymous" fields cause further processing issues
Environment
Checklist