Skip to content

Errors on api-with-examples.yaml example #288

@tfesenko

Description

@tfesenko

KaiZen shows errors on the api-with-examples.yaml OpenAPI v3 example.

Other examples from this PR are OK.

Probably it's related to the example definition in the JSON Schema which prohibits additional properties. Allowing them fixes three of four validation errors:

--- a/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json
+++ b/com.reprezen.swagedit.openapi3/src/com/reprezen/swagedit/openapi3/schema/schema_v3.json
@@ -619,7 +619,7 @@
     "example": {
       "type": "object",
       "description": "Allows sharing examples for operation requests and responses. This object can either be a freeform object, array or primitive value.  To represent examples of media types that cannot naturally represented in the OpenAPI definition, a string value can be used to contain the example with escaping where necessary.",
-      "additionalProperties": false
+      "additionalProperties": true
     },
     "links": {
       "type": "object",

Problem markers:

Description	Resource	Path	Location	Type
Failed to match exactly one schema:
 - /definitions/responseOrReference/oneOf/0:
	Failed to match exactly one schema:
	 - /definitions/exampleOrReference/oneOf/0:
		 - object has properties "version" which are not allowed
	 - /definitions/exampleOrReference/oneOf/1:
		 - object has properties "version" which are not allowed
		 - object has missing required properties "$ref"
 - /definitions/responseOrReference/oneOf/1:
	 - object has missing required properties "$ref"
	 - object has properties "content", "description" which are not allowed
	api-with-examples.yaml	/Foo	line 126	Problem
Failed to match exactly one schema:
 - /definitions/responseOrReference/oneOf/0:
	Failed to match exactly one schema:
	 - /definitions/exampleOrReference/oneOf/0:
		 - object has properties "version" which are not allowed
	 - /definitions/exampleOrReference/oneOf/1:
		 - object has properties "version" which are not allowed
		 - object has missing required properties "$ref"
 - /definitions/responseOrReference/oneOf/1:
	 - object has properties "content", "description" which are not allowed
	 - object has missing required properties "$ref"
	api-with-examples.yaml	/Foo	line 82	Problem
Failed to match exactly one schema:
 - /definitions/responseOrReference/oneOf/0:
	Failed to match exactly one schema:
	 - /definitions/exampleOrReference/oneOf/0:
		 - object has properties "versions" which are not allowed
	 - /definitions/exampleOrReference/oneOf/1:
		 - object has properties "versions" which are not allowed
		 - object has missing required properties "$ref"
 - /definitions/responseOrReference/oneOf/1:
	 - object has missing required properties "$ref"
	 - object has properties "content", "description" which are not allowed
	api-with-examples.yaml	/Foo	line 12	Problem
Failed to match exactly one schema:
 - /definitions/responseOrReference/oneOf/0:
	Failed to match exactly one schema:
	 - /definitions/exampleOrReference/oneOf/0:
		 - value of type string is not allowed, value should be of type object
	 - /definitions/exampleOrReference/oneOf/1:
		 - value of type string is not allowed, value should be of type object
 - /definitions/responseOrReference/oneOf/1:
	 - object has missing required properties "$ref"
	 - object has properties "content", "description" which are not allowed
	api-with-examples.yaml	/Foo	line 44	Problem

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions