Skip to content

3.1.0 spec procesing, nonexistant types added #1964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
spacether opened this issue Aug 19, 2023 · 0 comments
Open

3.1.0 spec procesing, nonexistant types added #1964

spacether opened this issue Aug 19, 2023 · 0 comments

Comments

@spacether
Copy link
Contributor

spacether commented Aug 19, 2023

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

@spacether spacether changed the title 3.1.0 spec procesing, nonexistant type added 3.1.0 spec procesing, nonexistant types added Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant