Add support for 'null' values in response.

Issue #37 resolved
Former user created an issue

In a nutshell, my model requires having 'null' values for some field in certain cases. Currently I get following error on such fields:

[ERROR] [Path '/data/0/workflow_instance/14/task_instance/2/actual_start_time'] Instance type (null) does not match any allowed primitive type (allowed: ["integer"])

I found no way to overcome this.

As a solution I see either supporting one of the 'x-nullable' kind of attributes in spec file (Please see https://github.com/OAI/OpenAPI-Specification/issues/229 for details, search for "x-nullable") or adding some setting to Validator to allow me decide if it should ignore all null values at once.

Thank you in advance. Alex.

Comments (5)

  1. James Navin

    Hi Alex,

    Im having trouble reproducing this problem.

    Would it be possible for you to provide an example Swagger spec and request that causes the problem?

    Thanks!

  2. James Navin

    Actually - I think I may have found it.

    The null cleanup code that is used in the schema validator doesn't traverse arrays properly - I can reproduce your error message if I have nulls in arrays, or in objects in arrays.

    Looking at the path in your example error msg I'd say thats what the problem is.

  3. Log in to comment