Skip to content

Commit

Permalink
Drop incorrect uri-reference OpenAPI formats
Browse files Browse the repository at this point in the history
Temporary fix until upstream schemas are fixed and published: OAI/OpenAPI-Specification#3455

Closes: #158
  • Loading branch information
davishmcclurg committed Nov 23, 2023
1 parent f48c563 commit 4fdbf0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lib/json_schemer/openapi30/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,7 @@ module Document
'type' => 'string'
},
'operationRef' => {
'type' => 'string',
'format' => 'uri-reference'
'type' => 'string'
},
'parameters' => {
'type' => 'object',
Expand Down
6 changes: 2 additions & 4 deletions lib/json_schemer/openapi31/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ def self.dialect_schema(dialect)
'type' => 'object',
'properties' => {
'url' => {
'type' => 'string',
'format' => 'uri-reference'
'type' => 'string'
},
'description' => {
'type' => 'string'
Expand Down Expand Up @@ -1054,8 +1053,7 @@ def self.dialect_schema(dialect)
'type' => 'object',
'properties' => {
'operationRef' => {
'type' => 'string',
'format' => 'uri-reference'
'type' => 'string'
},
'operationId' => {
'type' => 'string'
Expand Down
5 changes: 3 additions & 2 deletions test/json_schemer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ def test_published_meta_schemas
JSONSchemer::Draft4::SCHEMA,
JSONSchemer::OpenAPI31::SCHEMA,
JSONSchemer::OpenAPI31::Meta::BASE,
JSONSchemer::OpenAPI31::Document::SCHEMA,
JSONSchemer::OpenAPI30::Document::SCHEMA
# fixme: https://github.com/OAI/OpenAPI-Specification/pull/3455
# JSONSchemer::OpenAPI31::Document::SCHEMA,
# JSONSchemer::OpenAPI30::Document::SCHEMA
].each do |meta_schema|
id = meta_schema.key?('$id') ? meta_schema.fetch('$id') : meta_schema.fetch('id')
assert_equal(meta_schema, JSON.parse(fetch(id)))
Expand Down

0 comments on commit 4fdbf0c

Please sign in to comment.