Skip to content
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

not and $ref is not supported #450

Open
jmini opened this issue Jun 9, 2018 · 2 comments
Open

not and $ref is not supported #450

jmini opened this issue Jun 9, 2018 · 2 comments
Assignees

Comments

@jmini
Copy link

jmini commented Jun 9, 2018

Take this OAS3 spec:

openapi: 3.0.1
info:
  title: not test
  version: '1.0'
servers:
  - url: 'http://localhost:8000/'
paths:
  /some/ping:
    get:
      operationId: pingOp
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/SomeObj'
components:
  schemas:
    SomeObj:
      type: object
      properties:
        other:
          not:
            $ref: '#/components/schemas/OtherObj'
    OtherObj:
      type: string
      enum: [A, B, C]

KaiZen-OpenAPI-Editor

Error Marker

Failed to match exactly one schema:
 - schema:
	Failed to match exactly one schema:
	 - schema:
		 - object has properties "$ref" which are not allowed
	 - reference:
		 - object has properties "not" which are not allowed
		 - object has missing required properties "$ref"
 - reference:
	 - object has missing required properties "$ref"
	 - object has properties "properties", "type" which are not allowed

Warning Marker:

Invalid object reference, the referenced object is not of expected type.   

Tested with

KaiZen-OpenAPI-Editor	0.8.0.201805092300	com.reprezen.swagedit.feature.feature.group
@tedepstein
Copy link
Collaborator

@jmini , thanks for the bug report! Indeed this seems to be a case where the validation (and content assist) do not allow for a schema reference, only an inline schema.

We'll fix this.

@ghillairet
Copy link
Member

Looks like an issue with the schema. If we look at https://github.com/RepreZen/KaiZen-OpenAPI-Editor/blob/master/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json#L822 we see that not references #/definitions/schema. To make that work it should reference #/definitions/schemaOrReference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants