openapi: 3.0.0 info: description: This is a server for Catholic Polity info. license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Catholic Polity info version: 0.11.0 externalDocs: description: Find out more about Swagger url: http://swagger.io servers: - url: https://{env}-sg.portal.hocvienconggiao.com variables: env: default: dev enum: - dev - prod security: - polity_auth: [] tags: - description: Everything about your Polities name: polity paths: /mutation-api/catholic-polity-service/parishes: post: operationId: addParish requestBody: $ref: '#/components/requestBodies/ParishRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ParishMutation' description: successful operation "405": description: Invalid input security: - polity_auth: [] summary: Add new parish tags: - parish /mutation-api/catholic-polity-service/provinces: post: operationId: addProvince requestBody: $ref: '#/components/requestBodies/ProvinceRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProvinceMutation' description: successful operation "405": description: Invalid input security: - polity_auth: [] summary: Add new province tags: - province /mutation-api/catholic-polity-service/dioceses: post: operationId: addDiocese requestBody: $ref: '#/components/requestBodies/DioceseRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DioceseMutation' description: successful operation "405": description: Invalid input security: - polity_auth: [] summary: Add new diocese tags: - diocese /mutation-api/catholic-polity-service/deaneries: post: operationId: addDeanery requestBody: $ref: '#/components/requestBodies/DeaneryRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeaneryMutation' description: successful operation "405": description: Invalid input security: - polity_auth: [] summary: Add new deanery tags: - deanery /mutation-api/catholic-polity-service/institutes: post: operationId: addInstitute requestBody: $ref: '#/components/requestBodies/InstituteRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/InstituteMutation' description: successful operation "405": description: Invalid input security: - polity_auth: [] summary: Add new institute tags: - institute /query-api/catholic-polity-service/parishes: get: description: Returns all parishes operationId: getParishes parameters: - explode: true in: query name: deaneryId required: false schema: format: uuid type: string style: form - explode: true in: query name: dioceseId required: false schema: format: uuid type: string style: form - explode: true in: query name: name required: false schema: type: string style: form - description: The number of parishes to skip before starting to collect the result set. explode: true in: query name: offset required: false schema: minimum: 0 type: integer style: form - description: The number of parishes to return. explode: true in: query name: count required: false schema: default: 20 maximum: 100 minimum: 1 type: integer style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/ParishCollection' description: successful operation "400": description: Invalid ID supplied "404": description: Parish not found summary: Get all parishes tags: - parish /query-api/catholic-polity-service/provinces: get: description: Returns all provinces operationId: getProvinces parameters: - explode: true in: query name: name required: false schema: type: string style: form - explode: true in: query name: provinceCode required: false schema: $ref: '#/components/schemas/Code' style: form - description: The number of provinces to skip before starting to collect the result set. explode: true in: query name: offset required: false schema: minimum: 0 type: integer style: form - description: The number of provinces to return. explode: true in: query name: count required: false schema: default: 20 maximum: 100 minimum: 1 type: integer style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProvinceCollection' description: successful operation "400": description: Invalid ID supplied "404": description: Province not found summary: Get all provinces tags: - province /query-api/catholic-polity-service/dioceses: get: description: Returns all dioceses operationId: getDioceses parameters: - explode: true in: query name: provinceId required: false schema: format: uuid type: string style: form - explode: true in: query name: provinceCode required: false schema: $ref: '#/components/schemas/Code' style: form - explode: true in: query name: provinceName required: false schema: type: string style: form - explode: true in: query name: name required: false schema: type: string style: form - explode: true in: query name: locationName required: false schema: type: string style: form - explode: true in: query name: locationAddress required: false schema: type: string style: form - explode: true in: query name: locationEmail required: false schema: type: string style: form - explode: true in: query name: personInCharge required: false schema: type: string style: form - explode: true in: query name: sorts required: false schema: items: $ref: '#/components/schemas/DioceseSortCriteria' type: array style: form - description: The number of dioceses to skip before starting to collect the result set. explode: true in: query name: offset required: false schema: minimum: 0 type: integer style: form - description: The number of dioceses to return. explode: true in: query name: count required: false schema: default: 20 maximum: 100 minimum: 1 type: integer style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/DioceseCollection' description: successful operation "400": description: Invalid ID supplied "404": description: Diocese not found summary: Get all dioceses tags: - diocese /query-api/catholic-polity-service/deaneries: get: description: Returns all deaneries operationId: getDeaneries parameters: - explode: true in: query name: dioceseId required: false schema: format: uuid type: string style: form - explode: true in: query name: name required: false schema: type: string style: form - description: The number of deaneries to skip before starting to collect the result set. explode: true in: query name: offset required: false schema: minimum: 0 type: integer style: form - description: The number of deaneries to return. explode: true in: query name: count required: false schema: default: 20 maximum: 100 minimum: 1 type: integer style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeaneryCollection' description: successful operation "400": description: Invalid ID supplied "404": description: Deanery not found summary: Get deaneries tags: - deanery /query-api/catholic-polity-service/institutes: get: description: Returns all institutes operationId: getInstitutes parameters: - explode: true in: query name: name required: false schema: type: string style: form - explode: true in: query name: locationName required: false schema: type: string style: form - explode: true in: query name: locationAddress required: false schema: type: string style: form - explode: true in: query name: locationEmail required: false schema: type: string style: form - explode: true in: query name: personInCharge required: false schema: type: string style: form - explode: true in: query name: sorts required: false schema: items: $ref: '#/components/schemas/InstituteSortCriteria' type: array style: form - description: The number of institutes to skip before starting to collect the result set. explode: true in: query name: offset required: false schema: minimum: 0 type: integer style: form - description: The number of institutes to return. explode: true in: query name: count required: false schema: default: 20 maximum: 100 minimum: 1 type: integer style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/InstituteCollection' description: successful operation "400": description: Invalid ID supplied "404": description: Institute not found summary: Get institutes tags: - institute /query-api/catholic-polity-service/parishes/{id}: get: description: Returns a single parish operationId: getParishById parameters: - description: ID of parish to return explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "200": content: application/json: schema: $ref: '#/components/schemas/ParishView' description: successful operation "400": description: Invalid ID supplied "404": description: Parish not found summary: Find parish by ID tags: - parish /query-api/catholic-polity-service/provinces/{id}: get: description: Returns a single province operationId: getProvinceById parameters: - description: ID of province to return explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProvinceView' description: successful operation "400": description: Invalid ID supplied "404": description: Province not found summary: Find province by ID tags: - province /query-api/catholic-polity-service/dioceses/{id}: get: description: Returns a single diocese operationId: getDioceseById parameters: - description: ID of diocese to return explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "200": content: application/json: schema: $ref: '#/components/schemas/DioceseView' description: successful operation "400": description: Invalid ID supplied "404": description: Diocese not found summary: Find diocese by ID tags: - diocese /query-api/catholic-polity-service/deaneries/{id}: get: description: Returns a single deanery operationId: getDeaneryById parameters: - description: ID of deanery to return explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeaneryView' description: successful operation "400": description: Invalid ID supplied "404": description: Deanery not found summary: Find deanery by ID tags: - deanery /query-api/catholic-polity-service/institutes/{id}: get: description: Returns a single institute operationId: getInstituteById parameters: - description: ID of institute to return explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "200": content: application/json: schema: $ref: '#/components/schemas/InstituteView' description: successful operation "400": description: Invalid ID supplied "404": description: Institute not found summary: Find institute by ID tags: - institute /mutation-api/catholic-polity-service/parishes/{id}: delete: operationId: deleteParish parameters: - description: ID of parish to delete explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "204": description: successful operation "400": description: Invalid ID supplied "404": description: Parish not found security: - polity_auth: [] summary: Delete parish by ID tags: - parish put: operationId: updateParish parameters: - description: ID of parish to update explode: false in: path name: id required: true schema: format: uuid type: string style: simple requestBody: $ref: '#/components/requestBodies/ParishRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ParishMutation' description: successful operation "400": description: Invalid ID supplied "404": description: Parish not found "405": description: Validation exception security: - polity_auth: [] summary: Update an existing parish tags: - parish /mutation-api/catholic-polity-service/provinces/{id}: delete: operationId: deleteProvince parameters: - description: ID of province to delete explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "204": description: successful operation "400": description: Invalid ID supplied "404": description: Province not found security: - polity_auth: [] summary: Delete province by ID tags: - province put: operationId: updateProvince parameters: - description: ID of province to update explode: false in: path name: id required: true schema: format: uuid type: string style: simple requestBody: $ref: '#/components/requestBodies/ProvinceRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProvinceMutation' description: successful operation "400": description: Invalid ID supplied "404": description: Province not found "405": description: Validation exception security: - polity_auth: [] summary: Update an existing province tags: - province /mutation-api/catholic-polity-service/deaneries/{id}: delete: operationId: deleteDeanery parameters: - description: ID of deanery to delete explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "204": description: successful operation "400": description: Invalid ID supplied "404": description: Deanery not found security: - polity_auth: [] summary: Delete deanery by ID tags: - deanery put: operationId: updateDeanery parameters: - description: ID of deanery to update explode: false in: path name: id required: true schema: format: uuid type: string style: simple requestBody: $ref: '#/components/requestBodies/DeaneryRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DeaneryMutation' description: successful operation "400": description: Invalid ID supplied "404": description: Deanery not found "405": description: Validation exception security: - polity_auth: [] summary: Update an existing deanery tags: - deanery /mutation-api/catholic-polity-service/dioceses/{id}: delete: operationId: deleteDiocese parameters: - description: ID of diocese to delete explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "204": description: successful operation "400": description: Invalid ID supplied "404": description: Diocese not found security: - polity_auth: [] summary: Delete diocese by ID tags: - diocese put: operationId: updateDiocese parameters: - description: ID of diocese to update explode: false in: path name: id required: true schema: format: uuid type: string style: simple requestBody: $ref: '#/components/requestBodies/DioceseRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DioceseMutation' description: successful operation "400": description: Invalid ID supplied "404": description: Diocese not found "405": description: Validation exception security: - polity_auth: [] summary: Update an existing diocese tags: - diocese /mutation-api/catholic-polity-service/institutes/{id}: delete: operationId: deleteInstitute parameters: - description: ID of institute to delete explode: false in: path name: id required: true schema: format: uuid type: string style: simple responses: "204": description: successful operation "400": description: Invalid ID supplied "404": description: Institute not found security: - polity_auth: [] summary: Delete institute by ID tags: - institute put: operationId: updateInstitute parameters: - description: ID of institute to update explode: false in: path name: id required: true schema: format: uuid type: string style: simple requestBody: $ref: '#/components/requestBodies/InstituteRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/InstituteMutation' description: successful operation "400": description: Invalid ID supplied "404": description: Institute not found "405": description: Validation exception security: - polity_auth: [] summary: Update an existing institute tags: - institute components: requestBodies: ParishArray: content: application/json: schema: items: $ref: '#/components/schemas/ParishMutation' type: array description: List of parishes object required: true ParishRequest: content: application/json: schema: $ref: '#/components/schemas/ParishMutation' ProvinceArray: content: application/json: schema: items: $ref: '#/components/schemas/ProvinceMutation' type: array description: List of province object required: true ProvinceRequest: content: application/json: schema: $ref: '#/components/schemas/ProvinceMutation' DeaneryArray: content: application/json: schema: items: $ref: '#/components/schemas/DeaneryMutation' type: array description: List of deaneries object required: true DeaneryRequest: content: application/json: schema: $ref: '#/components/schemas/DeaneryMutation' description: Parish object that needs to be added to the database required: true DioceseArray: content: application/json: schema: items: $ref: '#/components/schemas/DioceseMutation' type: array description: List of dioceses object required: true DioceseRequest: content: application/json: schema: $ref: '#/components/schemas/DioceseMutation' description: Diocese object that needs to be added to the database required: true InstituteArray: content: application/json: schema: items: $ref: '#/components/schemas/InstituteMutation' type: array description: List of institutes object required: true InstituteRequest: content: application/json: schema: $ref: '#/components/schemas/InstituteMutation' description: Institute object that needs to be added to the database required: true schemas: DioceseSortCriteria: enum: - NAME_ASC - NAME_DESC - LOCATION_NAME_ASC - LOCATION_NAME_DESC - LOCATION_EMAIL_ASC - LOCATION_EMAIL_DESC - LOCATION_ADDRESS_ASC - LOCATION_ADDRESS_DESC type: string InstituteSortCriteria: enum: - NAME_ASC - NAME_DESC - LOCATION_NAME_ASC - LOCATION_NAME_DESC - LOCATION_EMAIL_ASC - LOCATION_EMAIL_DESC - LOCATION_ADDRESS_ASC - LOCATION_ADDRESS_DESC type: string Code: enum: - HA_NOI - HUE - SAI_GON type: string Polity: properties: id: format: uuid type: string name: type: string locationEmail: type: string locationAddress: type: string locationName: type: string personInCharge: type: string required: - name type: object ProvinceView: allOf: - $ref: '#/components/schemas/Polity' example: {} properties: code: $ref: '#/components/schemas/Code' required: - code type: object DioceseView: allOf: - $ref: '#/components/schemas/Polity' description: An area controlled by a ecclesiastical province example: province: {} properties: province: $ref: '#/components/schemas/ProvinceView' required: - province type: object DeaneryView: allOf: - $ref: '#/components/schemas/Polity' description: An area controlled by a diocese example: diocese: province: {} properties: diocese: $ref: '#/components/schemas/DioceseView' required: - diocese type: object ParishView: allOf: - $ref: '#/components/schemas/Polity' example: deanery: diocese: province: {} properties: deanery: $ref: '#/components/schemas/DeaneryView' required: - deanery type: object InstituteView: allOf: - $ref: '#/components/schemas/Polity' type: object DioceseCollection: example: total: 0 dioceses: - province: {} - province: {} hasMore: true properties: dioceses: items: $ref: '#/components/schemas/DioceseView' type: array hasMore: type: boolean total: format: int64 type: integer DeaneryCollection: example: total: 0 deaneries: - diocese: province: {} - diocese: province: {} hasMore: true properties: deaneries: items: $ref: '#/components/schemas/DeaneryView' type: array hasMore: type: boolean total: format: int64 type: integer ParishCollection: example: total: 0 hasMore: true parishes: - deanery: diocese: province: {} - deanery: diocese: province: {} properties: parishes: items: $ref: '#/components/schemas/ParishView' type: array hasMore: type: boolean total: format: int64 type: integer ProvinceCollection: example: provinces: - {} - {} total: 0 hasMore: true properties: provinces: items: $ref: '#/components/schemas/ProvinceView' type: array hasMore: type: boolean total: format: int64 type: integer InstituteCollection: example: total: 0 hasMore: true institutes: - null - null properties: institutes: items: $ref: '#/components/schemas/InstituteView' type: array hasMore: type: boolean total: format: int64 type: integer ProvinceMutation: allOf: - $ref: '#/components/schemas/Polity' example: {} properties: code: $ref: '#/components/schemas/Code' required: - code type: object DioceseMutation: allOf: - $ref: '#/components/schemas/Polity' description: An area controlled by a ecclesiastical province example: provinceId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: provinceId: format: uuid type: string required: - provinceId type: object DeaneryMutation: allOf: - $ref: '#/components/schemas/Polity' description: An area controlled by a diocese example: dioceseId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: dioceseId: format: uuid type: string required: - dioceseId type: object ParishMutation: allOf: - $ref: '#/components/schemas/Polity' example: deaneryId: 046b6c7f-0b8a-43b9-b35d-6489e6daee91 properties: deaneryId: format: uuid type: string required: - deaneryId type: object InstituteMutation: allOf: - $ref: '#/components/schemas/Polity' type: object securitySchemes: polity_auth: bearerFormat: JWT scheme: bearer type: http