Skip to content

Commit

Permalink
[IOPAE-687] add service topic to OpenAPI (#292)
Browse files Browse the repository at this point in the history
* add service topic to OpenAPI

* bump openapi version

* edit index.yaml.template

---------

Co-authored-by: Gianmaria Scorza <gianmaria@scorza.dev>
  • Loading branch information
rodoviti and giamma1295 authored Jan 2, 2024
1 parent 5f5fcf1 commit 45272ba
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 16 deletions.
86 changes: 78 additions & 8 deletions openapi/index.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: '2.0'
info:
version: 3.37.0
version: 3.38.0
title: IO API for Public Administration Services
contact:
name: PagoPA S.p.A.
Expand Down Expand Up @@ -617,6 +617,26 @@ paths:
description: Internal server error
schema:
$ref: '#/definitions/ProblemJson'
/manage/services/topics:
get:
tags:
- service-topics
summary: Retrieve all services
description: Retrieve all service topics
operationId: getServiceTopics
responses:
'200':
description: Service topics fetched successfully
schema:
$ref: '#/definitions/CmsServiceTopicList'
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Too many requests
'500':
description: Internal server error
/manage/services/{serviceId}:
get:
tags:
Expand Down Expand Up @@ -1818,7 +1838,9 @@ definitions:
$ref: '#/definitions/CmsServiceLifecycleStatus'
last_update:
$ref: '#/definitions/Timestamp'
- $ref: '#/definitions/CmsServicePayload'
metadata:
$ref: '#/definitions/CmsServiceMetadata'
- $ref: '#/definitions/CmsServiceData'
required:
- id
- status
Expand All @@ -1834,12 +1856,24 @@ definitions:
$ref: '#/definitions/CmsServicePublicationStatusType'
last_update:
$ref: '#/definitions/Timestamp'
- $ref: '#/definitions/CmsServicePayload'
metadata:
$ref: '#/definitions/CmsServiceMetadata'
- $ref: '#/definitions/CmsServiceData'
required:
- id
- status
- last_update
CmsServicePayload:
description: A payload used to create or update a service.
allOf:
- type: object
properties:
metadata:
$ref: '#/definitions/CmsServicePayloadMetadata'
required:
- metadata
- $ref: '#/definitions/CmsServiceData'
CmsServiceData:
type: object
description: Service basic data
properties:
Expand Down Expand Up @@ -1872,14 +1906,11 @@ definitions:
minimum: 0
maximum: 9999999999
default: 0
metadata:
$ref: '#/definitions/CmsServiceMetadata'
required:
- name
- description
- organization
- metadata
CmsServiceMetadata:
CmsServiceBaseMetadata:
type: object
description: A set of service metadata properties
properties:
Expand Down Expand Up @@ -1922,10 +1953,28 @@ definitions:
scope:
type: string
enum:
- NATIONAL
- LOCAL
- NATIONAL
required:
- scope
CmsServiceMetadata:
description: A set of service metadata properties
allOf:
- $ref: '#/definitions/CmsServiceBaseMetadata'
- type: object
properties:
topic:
$ref: '#/definitions/CmsServiceTopic'
CmsServicePayloadMetadata:
description: A set of service metadata properties on request payload
allOf:
- $ref: '#/definitions/CmsServiceBaseMetadata'
- type: object
properties:
topic_id:
type: number
description: The topic id
example: 3
CmsServiceLifecycleStatus:
type: object
properties:
Expand Down Expand Up @@ -2032,6 +2081,27 @@ definitions:
example: true
required:
- auto_publish
CmsServiceTopicList:
type: object
properties:
topics:
type: array
items:
$ref: '#/definitions/CmsServiceTopic'
CmsServiceTopic:
type: object
properties:
id:
type: number
description: The topic id
example: 3
name:
type: string
description: The topic name
example: Benessere sociale
required:
- id
- name
responses: {}
parameters:
LegalMail:
Expand Down
84 changes: 77 additions & 7 deletions openapi/index.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,26 @@ paths:
description: Internal server error
schema:
$ref: "#/definitions/ProblemJson"
"/manage/services/topics":
get:
tags:
- service-topics
summary: Retrieve all services
description: Retrieve all service topics
operationId: getServiceTopics
responses:
'200':
description: Service topics fetched successfully
schema:
$ref: '#/definitions/CmsServiceTopicList'
'401':
description: Unauthorized
'403':
description: Forbidden
'429':
description: Too many requests
'500':
description: Internal server error
"/manage/services/{serviceId}":
get:
tags:
Expand Down Expand Up @@ -1113,7 +1133,9 @@ definitions:
$ref: '#/definitions/CmsServiceLifecycleStatus'
last_update:
$ref: '#/definitions/Timestamp'
- $ref: '#/definitions/CmsServicePayload'
metadata:
$ref: '#/definitions/CmsServiceMetadata'
- $ref: '#/definitions/CmsServiceData'
required:
- id
- status
Expand All @@ -1129,12 +1151,24 @@ definitions:
$ref: '#/definitions/CmsServicePublicationStatusType'
last_update:
$ref: '#/definitions/Timestamp'
- $ref: '#/definitions/CmsServicePayload'
metadata:
$ref: '#/definitions/CmsServiceMetadata'
- $ref: '#/definitions/CmsServiceData'
required:
- id
- status
- last_update
CmsServicePayload:
description: A payload used to create or update a service.
allOf:
- type: object
properties:
metadata:
$ref: '#/definitions/CmsServicePayloadMetadata'
required:
- metadata
- $ref: '#/definitions/CmsServiceData'
CmsServiceData:
type: object
description: Service basic data
properties:
Expand Down Expand Up @@ -1167,14 +1201,11 @@ definitions:
minimum: 0
maximum: 9999999999
default: 0
metadata:
$ref: '#/definitions/CmsServiceMetadata'
required:
- name
- description
- organization
- metadata
CmsServiceMetadata:
CmsServiceBaseMetadata:
type: object
description: A set of service metadata properties
properties:
Expand Down Expand Up @@ -1216,9 +1247,27 @@ definitions:
minLength: 1
scope:
type: string
enum: [NATIONAL, LOCAL]
enum: [LOCAL, NATIONAL]
required:
- scope
CmsServiceMetadata:
description: A set of service metadata properties
allOf:
- $ref: '#/definitions/CmsServiceBaseMetadata'
- type: object
properties:
topic:
$ref: '#/definitions/CmsServiceTopic'
CmsServicePayloadMetadata:
description: A set of service metadata properties on request payload
allOf:
- $ref: '#/definitions/CmsServiceBaseMetadata'
- type: object
properties:
topic_id:
type: number
description: The topic id
example: 3
CmsServiceLifecycleStatus:
type: object
properties:
Expand Down Expand Up @@ -1303,6 +1352,27 @@ definitions:
example: true
required:
- auto_publish
CmsServiceTopicList:
type: object
properties:
topics:
type: array
items:
$ref: '#/definitions/CmsServiceTopic'
CmsServiceTopic:
type: object
properties:
id:
type: number
description: The topic id
example: 3
name:
type: string
description: The topic name
example: 'Benessere sociale'
required:
- id
- name

responses: {}
parameters:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pagopa/io-functions-services",
"version": "3.37.0",
"version": "3.38.0",
"license": "MIT",
"scripts": {
"prebuild": "shx rm -rf dist && yarn generate",
Expand Down

0 comments on commit 45272ba

Please sign in to comment.