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

Swagger docs for RepresentationManagement::V0::AccreditedEntitiesForAppointController #19522

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
289c991
[WIP] Start new swagger docs
opticbob Nov 19, 2024
569fefc
[WIP] Simple docs so far
opticbob Nov 19, 2024
ca6d5d2
Support array with multiple object types
opticbob Nov 20, 2024
472102e
[WIP] Trying to get schema objects to show in response
opticbob Nov 20, 2024
5d59d76
[WIP] Trying to get exported docs to match actual response
opticbob Nov 20, 2024
f547616
[WIP] adding debugging output
opticbob Nov 21, 2024
e5f267f
[WIP] Working but wrong response
opticbob Nov 21, 2024
a2f06db
[WIP] Schema in correct any order array
opticbob Nov 22, 2024
fd9dc6c
[WIP] Accurate individual serializer output
opticbob Nov 22, 2024
5c9d628
Fill out nullable attributes
opticbob Nov 22, 2024
3b49086
Rswag spec passing with additional attributes
opticbob Nov 22, 2024
ffc63eb
Final tweaks to swagger docs
opticbob Nov 22, 2024
44e0de7
Clean up comments and debugging output
opticbob Nov 25, 2024
447f7e6
Restore original param structure
opticbob Nov 25, 2024
602cde4
Refactor methods to share attributes
opticbob Nov 25, 2024
35a23db
Merge branch 'master' into 91484-add-swagger-documentation-for-repres…
opticbob Nov 25, 2024
aa70207
Merge branch 'master' into 91484-add-swagger-documentation-for-repres…
opticbob Nov 25, 2024
34d1e9b
Merge branch 'master' into 91484-add-swagger-documentation-for-repres…
opticbob Nov 25, 2024
b542a43
Address changes requested in review
opticbob Nov 26, 2024
618f1a4
Merge branch 'master' into 91484-add-swagger-documentation-for-repres…
opticbob Nov 26, 2024
d796337
Merge branch 'master' into 91484-add-swagger-documentation-for-repres…
opticbob Dec 3, 2024
1119bd2
Intergrate original entities swagger work
opticbob Dec 3, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def index
render json: json_response
end

private

def feature_enabled
routing_error unless Flipper.enabled?(:appoint_a_representative_enable_pdf)
end
Expand Down
262 changes: 262 additions & 0 deletions modules/representation_management/app/swagger/v0/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,272 @@
}
}
}
},
"accreditedIndividual": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "0bfddcc5-fe3c-4ffb-a4c7-70f5e23bde23"
},
"type": {
"type": "string",
"example": "individual"
},
"attributes": {
"type": "object",
"properties": {
"address_line1": {
"type": "string",
"example": "123 Main St"
},
"address_line2": {
"type": "string",
"example": "Apt 4",
"nullable": true
},
"address_line3": {
"type": "string",
"example": "Suite 100",
"nullable": true
},
"address_type": {
"type": "string",
"example": "Domestic"
},
"city": {
"type": "string",
"example": "Anytown"
},
"country_name": {
"type": "string",
"example": "USA",
"nullable": true
},
"country_code_iso3": {
"type": "string",
"example": "USA",
"nullable": true
},
"province": {
"type": "string",
"example": "New York",
"nullable": true
},
"international_postal_code": {
"type": "string",
"example": "",
"nullable": true
},
"state_code": {
"type": "string",
"example": "NY"
},
"zip_code": {
"type": "string",
"example": "12345"
},
"zip_suffix": {
"type": "string",
"example": "6789",
"nullable": true
},
"first_name": {
"type": "string",
"example": "John"
},
"last_name": {
"type": "string",
"example": "Doe"
},
"full_name": {
"type": "string",
"example": "John Doe"
},
"phone": {
"type": "string",
"example": "555-555-5555"
},
"email": {
"type": "string",
"example": "[email protected]"
},
"individual_type": {
"type": "string",
"enum": [
"attorney",
"claims_agent",
"representative"
],
"example": "attorney"
},
"accredited_organizations": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/accreditedOrganization"
}
}
}
}
}
}
}
}
}
},
"accreditedOrganization": {
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "0bfddcc5-fe3c-4ffb-a4c7-70f5e23bde23"
},
"type": {
"type": "string",
"example": "organization"
},
"attributes": {
"type": "object",
"properties": {
"address_line1": {
"type": "string",
"example": "123 Main St"
},
"address_line2": {
"type": "string",
"example": "Apt 4",
"nullable": true
},
"address_line3": {
"type": "string",
"example": "Suite 100",
"nullable": true
},
"address_type": {
"type": "string",
"example": "Domestic"
},
"city": {
"type": "string",
"example": "Anytown"
},
"country_name": {
"type": "string",
"example": "USA",
"nullable": true
},
"country_code_iso3": {
"type": "string",
"example": "USA",
"nullable": true
},
"province": {
"type": "string",
"example": "New York",
"nullable": true
},
"international_postal_code": {
"type": "string",
"example": "",
"nullable": true
},
"state_code": {
"type": "string",
"example": "NY"
},
"zip_code": {
"type": "string",
"example": "12345"
},
"zip_suffix": {
"type": "string",
"example": "6789",
"nullable": true
},
"poa_code": {
"type": "string",
"example": "123"
},
"name": {
"type": "string",
"example": "Organization Name"
},
"phone": {
"type": "string",
"example": "555-555-5555"
},
"lat": {
"type": "number",
"format": "float",
"example": 37.7749,
"nullable": true
},
"long": {
"type": "number",
"format": "float",
"example": -122.4194,
"nullable": true
}
}
}
}
}
}
}
}
},
"paths": {
"/representation_management/v0/accredited_entities_for_appoint": {
"get": {
"summary": "Accredited Entities for Appoint",
"tags": [
"Accredited Entities for Appoint"
],
"operationId": "accreditedEntitiesForAppoint",
"parameters": [
{
"name": "query",
"in": "query",
"description": "Search query",
"example": "Bob",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/accreditedIndividual"
},
{
"$ref": "#/components/schemas/accreditedOrganization"
}
]
}
}
}
}
}
}
}
},
"/representation_management/v0/original_entities": {
"get": {
"summary": "Original Entities",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# frozen_string_literal: true

require 'swagger_helper'
require Rails.root.join('spec', 'rswag_override.rb').to_s
require_relative '../../../support/swagger_shared_components/v0'

RSpec.describe 'Accredited Entities for Appoint',
openapi_spec: 'modules/representation_management/app/swagger/v0/swagger.json',
type: :request do
before do
create(:accredited_organization,
:with_location,
name: "Bob Law's Law Firm",
poa_code: '123',
address_type: 'Domestic',
address_line1: '123 Main St',
city: 'Anytown',
state_code: 'NY',
zip_code: '12345',
phone: '123-456-7890')
create(:accredited_individual,
:with_location,
first_name: 'Bob',
last_name: 'Law',
full_name: 'Bob Law',
address_type: 'Domestic',
address_line1: '123 Main St',
city: 'Anytown',
country_name: 'USA',
country_code_iso3: 'USA',
province: 'New York',
state_code: 'NY',
zip_code: '12345',
phone: '123-456-7890',
email: '[email protected]',
individual_type: 'attorney')
end

path '/representation_management/v0/accredited_entities_for_appoint' do
get('Accredited Entities for Appoint') do
tags 'Accredited Entities for Appoint'
consumes 'application/json'
produces 'application/json'
operationId 'accreditedEntitiesForAppoint'

parameter name: :query, in: :query, type: :string, description: 'Search query', example: 'Bob'

response '200', 'OK' do
let(:query) { 'Bob' }
schema type: :array,
items: {
anyOf: [
{ '$ref' => '#/components/schemas/accreditedIndividual' },
{ '$ref' => '#/components/schemas/accreditedOrganization' }
]
}
run_test!
end
end
end
end
Loading
Loading