Skip to content

3.1.0 spec procesing, nonexistant types added #1964

@spacether

Description

@spacether

When parsing this spec:

# OAS document that uses 3.1 features: # 'null' type # type array openapi: 3.1.0 info: version: 1.0.0 title: Example license: name: MIT identifier: MIT servers: - url: http://api.example.xyz/v1 paths: /somePath: get: operationId: getSomePath responses: '200': description: OK content: application/json: schema: {} components: schemas: ArrayContainsValue: type: array contains: enum: - 1 AnyTypeContainsValue: contains: enum: - 1 AdditionalpropertiesBeingFalseDoesNotAllowOtherProperties: $schema: https://json-schema.org/draft/2020-12/schema properties: foo: {} bar: {} patternProperties: ^v: {} additionalProperties: false 
  1. The schema in ArrayContainsValue.contains is given the property types = LinkedHashSet("number")
    This is incorrect because we see from the schema above that the schema there only defines an enum value and that anytype (type unset/null) is the correct definition.
  2. Type object is incorrectly set for AdditionalpropertiesBeingFalseDoesNotAllowOtherProperties

Can the parser be updated to show that the type for this use case is null?

This bug was hit on the additionalProperties test case AdditionalpropertiesBeingFalseDoesNotAllowOtherProperties when working on openapi-json-schema-tools/openapi-json-schema-generator#241

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions