To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaborator$ref defererencing through inlining
- Background
-
- Given
-
a checked file "lurker/api/v3/users/__id-PATCH.json.yml" with:
--- description: user updating prefix: users management requestParameters: description: '' type: object additionalProperties: false required: [] properties: user: "$ref": "../../../definitions/user_request_parameters.json#/" responseCodes: - status: 200 successful: true description: '' responseParameters: "$ref": "../../../definitions/user.json#/" extensions: method: PATCH path_info: "/api/v3/users/1" path_params: controller: api/v3/users action: update id: '1'
- And
-
a file named "lurker/definitions/user_request_parameters.json" with:
{ "properties": { "name": { "type": "string", "example": "Bob" } } }
- And
-
a file named "lurker/definitions/user.json.yml" with:
--- properties: id: type: integer example: 1 name: type: string example: razum2um surname: type: string example: Unknown
- And
-
a file named "spec/controllers/api/v3/users_controller_spec.rb" with:
describe Api::V3::UsersController, :lurker do render_views let(:user) do User.where(name: 'razum2um', surname: 'Unknown').first_or_create! end it "updates a user surname as string" do patch :update, params: { id: user.id, user: { surname: 'Marley' } } expect(response).to be_success end end
- Scenarios
-
- json schema left $ref keyword as is using "users/update"
-
- When
-
I run
bin/rspec spec/controllers/api/v3/users_controller_spec.rb
- Then
- the example should pass
- Then
- a file named "lurker/api/v3/users/__id-PATCH.json.yml" should exist
- Then
- the checked file "lurker/api/v3/users/__id-PATCH.json.yml" should not change
- Then
- a file named "lurker/definitions/user_request_parameters.json" should exist
- Then
-
the file "lurker/definitions/user_request_parameters.json" should contain exactly:
{ "properties": { "name": { "type": "string", "example": "Bob", "description": "" }, "surname": { "description": "", "type": "string", "example": "Marley" } }, "description": "", "type": "object", "additionalProperties": false, "required": [ ] }
Last published about 2 years ago by razum2um.