Closed
Description
I'm trying to restrict properties by setting additionalProperties: false. However, this seems to crash the YAML parser with a NullPointerException. When testing, please note that the most visible error is a syntax error from the JSON parser which kicks in after the YAML parser failed.
Main.java:
public class NpeDemo {
public static void main(String[] args) {
Swagger swagger = new SwaggerParser().read("npe-demo.yaml", null, true);
}
}
npe-demo.yaml:
swagger: '2.0'
definitions:
Demo:
type: object
additionalProperties: false
properties:
foo:
type: string
paths:
/demo:
get:
responses:
200:
description: blah
The problem happens in PropertyDeserializer.deserialize(JsonParser jp, DeserializationContext ctxt): The propertyFromNode(node) call returns null, which causes the NPE in the next line.
Metadata
Metadata
Assignees
Labels
No labels