swagger-parser
swagger-parser copied to clipboard
Object schema property field data type validation of OpenAPIV3Parser
Hi team I'm using OpenAPIV3Parser for getting openapi specifications. This is the way I used to parse the openAPI yaml file
String openAPIFileContent = Files.readString(openapi.yaml);
ParseOptions parseOptions = new ParseOptions();
parseOptions.setResolve(true);
SwaggerParseResult parseResult = new OpenAPIV3Parser().readContents(openAPIFileContent, null, parseOptions);
Could you please let me know whether there is a way of getting datatype validation warnings or errors when I provide YAML with an invalid data type to the property data type?
sample of code: invalid field is id with datatype int.
...
components:
schemas:
User:
type: object
properties:
id:
type: int
name:
type: string