Skip to content

Commit ecafd1f

Browse files
authored
Amend typoes (#944)
* Amend some documentation specific typoes * Address some typoes in tests * Amend source typo * Fix typo in parameter call * Pencil in contribution line
1 parent fddae76 commit ecafd1f

13 files changed

+24
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#### Fixes
88

99
* [#943](https://github.com/ruby-grape/grape-swagger/pull/943): Fix route_param documentation and type - [@4ndv](https://github.com/4ndv)
10+
* [#944](https://github.com/ruby-grape/grape-swagger/pull/944): Amend a few typographic errors - [@pieterocp](https://github.com/pieterocp)
1011
* Your contribution here.
1112

1213

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ add_swagger_documentation \
485485

486486
#### Swagger Header Parameters <a name="headers"></a>
487487

488-
Swagger also supports the documentation of parameters passed in the header. Since grape's ```params[]``` doesn't return header parameters we can specify header parameters seperately in a block after the description.
488+
Swagger also supports the documentation of parameters passed in the header. Since grape's ```params[]``` doesn't return header parameters we can specify header parameters separately in a block after the description.
489489

490490
```ruby
491491
desc "Return super-secret information", {
@@ -955,7 +955,8 @@ The result is then something like following:
955955

956956
#### Changing default status codes <a name="change-status"></a>
957957

958-
The default status codes, one could be found (-> [status codes](lib/grape-swagger/doc_methods/status_codes.rb)) can be changed to your specific needs, to achive it, you have to change it for grape itself and for the documentation.
958+
959+
The default status codes, one could be found (-> [status codes](lib/grape-swagger/doc_methods/status_codes.rb)) can be changed to your specific needs, to achieve it, you have to change it for grape itself and for the documentation.
959960

960961
```ruby
961962
desc 'Get a list of stuff',
@@ -1678,7 +1679,7 @@ This is how to configure the grape_swagger documentation:
16781679
The guard method should inject the Security Requirement Object into the endpoint's route settings (see Grape::DSL::Settings.route_setting method).
16791680

16801681
The 'oauth2 false' added to swagger_documentation is making the main Swagger endpoint protected with OAuth, i.e. the
1681-
access_token is being retreiving from the HTTP request, but the 'false' scope is for skipping authorization and
1682+
access_token is being retrieving from the HTTP request, but the 'false' scope is for skipping authorization and
16821683
showing the UI for everyone. If the scope would be set to something else, like 'oauth2 admin', for example, than the UI
16831684
wouldn't be displayed at all to unauthorized users.
16841685

@@ -1786,7 +1787,7 @@ params:
17861787
- store={ true | file_name.json } – save as JSON (optional)
17871788
- resource=resource_name – get only for this one (optional)
17881789
```
1789-
For mutliversion API it creates several files with following naming: file_name_`API_VERSION`.json
1790+
For multiversion API it creates several files with following naming: file_name_`API_VERSION`.json
17901791

17911792
#### OpenApi/Swagger Validation
17921793

lib/grape-swagger/rake/oapi_tasks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def make_request(url)
8787
get url
8888

8989
@oapi = JSON.pretty_generate(
90-
JSON.parse(last_response.body, symolize_names: true)
90+
JSON.parse(last_response.body, symbolize_names: true)
9191
) + "\n"
9292
end
9393
# rubocop:enable Style/StringConcatenation

spec/issues/430_entity_definitions_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class FourthEntity < Grape::Entity
3737
end
3838

3939
class Class5
40-
class FithEntity < Class4::FourthEntity
41-
expose :fith_thing
40+
class FifthEntity < Class4::FourthEntity
41+
expose :fifth_thing
4242
end
4343
end
4444

@@ -69,7 +69,7 @@ class NameApi < Grape::API
6969
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class2::Entities,
7070
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class3::Entity,
7171
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class4::FourthEntity,
72-
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class5::FithEntity,
72+
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class5::FifthEntity,
7373
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class6::SixthEntity,
7474
DummyEntities::WithVeryLongName::AnotherGroupingModule::Class7::SeventhEntity
7575
]
@@ -88,7 +88,7 @@ class NameApi < Grape::API
8888
specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class2' }
8989
specify { expect(subject).to include 'FooKlass' }
9090
specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class4_FourthEntity' }
91-
specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class5_FithEntity' }
91+
specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class5_FifthEntity' }
9292
specify { expect(subject).to include 'BarKlass' }
9393
specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class7_SeventhEntity' }
9494
end

spec/issues/923_params_schema_definition_for_delete_action_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
end
1717
end
1818

19-
describe 'retrieves the documentation for delete parameters as a schema defintion' do
19+
describe 'retrieves the documentation for delete parameters as a schema definition' do
2020
subject do
2121
get '/swagger_doc'
2222
JSON.parse(last_response.body)

spec/support/model_parsers/entity_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class DocumentedHashAndArrayModel < Grape::Entity
165165
}
166166
end
167167

168-
let(:swagger_typed_defintion) do
168+
let(:swagger_typed_definition) do
169169
{
170170
'prop_boolean' => { 'description' => 'prop_boolean description', 'type' => 'boolean' },
171171
'prop_date' => { 'description' => 'prop_date description', 'type' => 'string', 'format' => 'date' },
@@ -239,7 +239,7 @@ class DocumentedHashAndArrayModel < Grape::Entity
239239
{ 'in' => 'formData', 'name' => 'text', 'description' => 'Content of something.', 'type' => 'string', 'required' => true },
240240
{ 'in' => 'formData', 'name' => 'links', 'type' => 'array', 'items' => { 'type' => 'string' }, 'required' => true }
241241
],
242-
'responses' => { '201' => { 'description' => 'This creates Thing.', 'schema' => { '$ref' => '#/definitions/Something' } }, '422' => { 'description' => 'Unprocessible Entity' } },
242+
'responses' => { '201' => { 'description' => 'This creates Thing.', 'schema' => { '$ref' => '#/definitions/Something' } }, '422' => { 'description' => 'Unprocessable Entity' } },
243243
'tags' => ['thing'],
244244
'operationId' => 'postThing'
245245
}

spec/support/model_parsers/mock_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class ApiResponse < OpenStruct; end
183183
}
184184
end
185185

186-
let(:swagger_typed_defintion) do
186+
let(:swagger_typed_definition) do
187187
{
188188
'mock_data' => {
189189
'type' => 'string',
@@ -247,7 +247,7 @@ class ApiResponse < OpenStruct; end
247247
{ 'in' => 'formData', 'name' => 'text', 'description' => 'Content of something.', 'type' => 'string', 'required' => true },
248248
{ 'in' => 'formData', 'name' => 'links', 'type' => 'array', 'items' => { 'type' => 'string' }, 'required' => true }
249249
],
250-
'responses' => { '201' => { 'description' => 'This creates Thing.', 'schema' => { '$ref' => '#/definitions/Something' } }, '422' => { 'description' => 'Unprocessible Entity' } },
250+
'responses' => { '201' => { 'description' => 'This creates Thing.', 'schema' => { '$ref' => '#/definitions/Something' } }, '422' => { 'description' => 'Unprocessable Entity' } },
251251
'tags' => ['thing'],
252252
'operationId' => 'postThing'
253253
}

spec/support/model_parsers/representable_parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class DocumentedHashAndArrayModel < Representable::Decorator
237237
}
238238
end
239239

240-
let(:swagger_typed_defintion) do
240+
let(:swagger_typed_definition) do
241241
{
242242
'prop_boolean' => { 'description' => 'prop_boolean description', 'type' => 'boolean' },
243243
'prop_date' => { 'description' => 'prop_date description', 'type' => 'string', 'format' => 'date' },
@@ -311,7 +311,7 @@ class DocumentedHashAndArrayModel < Representable::Decorator
311311
{ 'in' => 'formData', 'name' => 'text', 'description' => 'Content of something.', 'type' => 'string', 'required' => true },
312312
{ 'in' => 'formData', 'name' => 'links', 'type' => 'array', 'items' => { 'type' => 'string' }, 'required' => true }
313313
],
314-
'responses' => { '201' => { 'description' => 'This creates Thing.', 'schema' => { '$ref' => '#/definitions/Something' } }, '422' => { 'description' => 'Unprocessible Entity' } },
314+
'responses' => { '201' => { 'description' => 'This creates Thing.', 'schema' => { '$ref' => '#/definitions/Something' } }, '422' => { 'description' => 'Unprocessable Entity' } },
315315
'tags' => ['thing'],
316316
'operationId' => 'postThing'
317317
}

spec/swagger_v2/api_swagger_v2_detail_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def do_good
2323
end
2424

2525
describe 'details' do
26-
describe 'take deatils as it is' do
26+
describe 'take details as it is' do
2727
include_context "#{MODEL_PARSER} swagger example"
2828

2929
before :all do

spec/swagger_v2/api_swagger_v2_extensions_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ExtensionsApi < Grape::API
4545

4646
desc 'This returns something with extension on definition level',
4747
success: Entities::OtherItem
48-
get '/non_existend_status_definitions_extension' do
48+
get '/non_existent_status_definitions_extension' do
4949
{ 'declared_params' => declared(params) }
5050
end
5151

@@ -132,7 +132,7 @@ def app
132132

133133
describe 'extension on definition level' do
134134
subject do
135-
get '/swagger_doc/non_existend_status_definitions_extension'
135+
get '/swagger_doc/non_existent_status_definitions_extension'
136136
JSON.parse(last_response.body)
137137
end
138138

spec/swagger_v2/api_swagger_v2_mounted_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def app
5252
requires :text, type: String, documentation: { type: 'string', desc: 'Content of something.' }
5353
requires :links, type: Array, documentation: { type: 'link', is_array: true }
5454
end
55-
post '/thing', http_codes: [{ code: 422, message: 'Unprocessible Entity' }] do
55+
post '/thing', http_codes: [{ code: 422, message: 'Unprocessable Entity' }] do
5656
something = OpenStruct.new text: 'something'
5757
present something, with: Entities::Something
5858
end

spec/swagger_v2/api_swagger_v2_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def app
5151
requires :text, type: String, documentation: { type: 'string', desc: 'Content of something.' }
5252
requires :links, type: Array, documentation: { type: 'link', is_array: true }
5353
end
54-
post '/thing', http_codes: [{ code: 422, message: 'Unprocessible Entity' }] do
54+
post '/thing', http_codes: [{ code: 422, message: 'Unprocessable Entity' }] do
5555
something = OpenStruct.new text: 'something'
5656
present something, with: Entities::Something
5757
end

spec/swagger_v2/api_swagger_v2_type-format_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ def app
8585
end
8686

8787
specify do
88-
expect(subject['definitions']['TypedDefinition']['properties']).to eql(swagger_typed_defintion)
88+
expect(subject['definitions']['TypedDefinition']['properties']).to eql(swagger_typed_definition)
8989
end
9090
end

0 commit comments

Comments
 (0)