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

fix Type null to nullable: true #18

Merged
merged 6 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rspec/openapi/schema_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def build_type(value)
when ActionDispatch::Http::UploadedFile
{ type: 'string', format: 'binary' }
when NilClass
{ type: 'null' }
{ nullable: true }
else
raise NotImplementedError, "type detection is not implemented for: #{value.inspect}"
end
Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/controllers/tables_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def find_table(id = nil)
id: 2,
name: 'production',
},
null_sample: nil,
storage_size: 12.3,
created_at: time.iso8601,
updated_at: time.iso8601,
Expand Down
15 changes: 15 additions & 0 deletions spec/rails/doc/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ paths:
type: integer
name:
type: string
null_sample:
nullable: true
storage_size:
type: number
format: float
Expand All @@ -61,6 +63,7 @@ paths:
database:
id: 2
name: production
null_sample:
storage_size: 12.3
created_at: '2020-07-17T00:00:00+00:00'
updated_at: '2020-07-17T00:00:00+00:00'
Expand Down Expand Up @@ -116,6 +119,8 @@ paths:
type: integer
name:
type: string
null_sample:
nullable: true
storage_size:
type: number
format: float
Expand All @@ -130,6 +135,7 @@ paths:
database:
id: 2
name: production
null_sample:
storage_size: 12.3
created_at: '2020-07-17T00:00:00+00:00'
updated_at: '2020-07-17T00:00:00+00:00'
Expand Down Expand Up @@ -166,6 +172,8 @@ paths:
type: integer
name:
type: string
null_sample:
nullable: true
storage_size:
type: number
format: float
Expand All @@ -180,6 +188,7 @@ paths:
database:
id: 2
name: production
null_sample:
storage_size: 12.3
created_at: '2020-07-17T00:00:00+00:00'
updated_at: '2020-07-17T00:00:00+00:00'
Expand Down Expand Up @@ -248,6 +257,8 @@ paths:
type: integer
name:
type: string
null_sample:
nullable: true
storage_size:
type: number
format: float
Expand All @@ -262,6 +273,7 @@ paths:
database:
id: 2
name: production
null_sample:
storage_size: 12.3
created_at: '2020-07-17T00:00:00+00:00'
updated_at: '2020-07-17T00:00:00+00:00'
Expand Down Expand Up @@ -297,6 +309,8 @@ paths:
type: integer
name:
type: string
null_sample:
nullable: true
storage_size:
type: number
format: float
Expand All @@ -311,6 +325,7 @@ paths:
database:
id: 2
name: production
null_sample:
storage_size: 12.3
created_at: '2020-07-17T00:00:00+00:00'
updated_at: '2020-07-17T00:00:00+00:00'
Expand Down