Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of new admin_api.yaml conformant with OAS which maintain object-relations.
swagger: '2.0'
info:
version: 0.1.0
title: Digital Citizenship Admin API.
description: Digital Citizenship Admin API.
basePath: "/adm"
schemes:
- https
paths:
"/services/{service_id}":
parameters:
- name: service_id
in: path
type: string
required: true
description: The ID of an existing Service.
get:
operationId: getService
summary: Get Service
description: A previously created service with the provided service ID is returned.
responses:
'200':
description: Service found.
schema:
"$ref": "#/definitions/Service"
examples:
application/json:
id: 2b3e728c1a5d1efa035c-0000000000000001
authorized_recipients:
- XXXYYY79A95Y000X
department_name: dept
organization_name: org
service_id: 2b3e728c1a5d1efa035c
service_name: service
version: 1
authorized_cidrs: []
'401':
description: Unauthorized
'404':
description: No service found for the provided ID.
parameters: []
put:
responses:
'200':
description: Service updated.
schema:
"$ref": "#/definitions/Service"
examples:
application/json:
id: 2b3e728c1a5d1efa035c-0000000000000001
authorized_recipients:
- XXXYYY79A95Y000X
department_name: dept
organization_name: org
service_id: 2b3e728c1a5d1efa035c
service_name: service
version: 1
authorized_cidrs: []
'401':
description: Unauthorized
'404':
description: No service found for the provided ID.
summary: Update Service
operationId: updateService
description: |-
Update an existing service with the attributes provided in the
request payload.
parameters:
- in: body
name: body
schema:
"$ref": "#/definitions/Service"
description: The Service payload.
x-examples:
application/json:
authorized_recipients:
- XXXYYY79A95Y000X
department_name: dept
organization_name: org
service_id: 2b3e728c1a5d1efa035c
service_name: service
authorized_cidrs: []
"/debug":
get:
responses:
'200':
description: |-
Returns a JSON object with HTTP request parameters, headers
and payload.
schema:
type: object
properties: {}
examples:
application/json:
auth:
groups:
- ApiInfoRead
- ApiMessageRead
- ApiLimitedMessageWrite
- ApiDebugRead
kind: IAzureApiAuthorization
subscriptionId: 9d39a48a64370b1b326dfb70307008
userId: 9d39a48a64370b1b326dfb70307008
headers:
cache-control: no-cache
connection: Keep-Alive
accept: application/json
accept-encoding: gzip, deflate
max-forwards: '10'
user-agent: PostmanRuntime/6.4.1
ocp-apim-subscription-key: d5310672bc1d8cf383ca98
x-user-id: 9d39a48a64370b1b326dfb70307008
x-user-groups: Developers,ApiInfoRead,ApiMessageRead,ApiLimitedMessageWrite,ApiDebugRead
x-subscription-id: 9d39a48a64370b1b326dfb70307008
x-user-email: example@example.com
x-functions-key: 9d39a48a64370b1b326dfb70307008
x-forwarded-for: 111.97.111.36, 111.40.111.45:1088
x-waws-unencoded-url: "/adm/debug"
x-original-url: "/adm/debug"
x-arr-log-id: 9d39a48-a64370b-1b326dfb703-07008
x-forwarded-proto: https
content-type: application/json
content-length: '0'
params: {}
user:
email: example@example.com
kind: IAzureUserAttributes
service:
authorized_recipients:
- XXXBEN86A11Y755X
department_name: dept
organization_name: org
service_id: 9d39a48a64370b1b326dfb70307008
service_name: service
id: 9d39a48a64370b1b326dfb70307008-0000000000000000
version: 0
authorized_cidrs: []
kind: IRetrievedService
'401':
description: Unauthorized
description: An endpoint to debug GET requests to the API backend.
operationId: getDebug
summary: Debug GET
post:
responses:
'200':
description: |-
Returns a JSON object with HTTP request parameters, headers
and payload.
schema:
type: object
properties: {}
examples:
application/json:
auth:
groups:
- ApiInfoRead
- ApiMessageRead
- ApiLimitedMessageWrite
- ApiDebugRead
kind: IAzureApiAuthorization
subscriptionId: 9d39a48a64370b1b326dfb70307008
userId: 9d39a48a64370b1b326dfb70307008
headers:
cache-control: no-cache
connection: Keep-Alive
accept: application/json
accept-encoding: gzip, deflate
max-forwards: '10'
user-agent: PostmanRuntime/6.4.1
ocp-apim-subscription-key: d5310672bc1d8cf383ca98
x-user-id: 9d39a48a64370b1b326dfb70307008
x-user-groups: Developers,ApiInfoRead,ApiMessageRead,ApiLimitedMessageWrite,ApiDebugRead
x-subscription-id: 9d39a48a64370b1b326dfb70307008
x-user-email: example@example.com
x-functions-key: 9d39a48a64370b1b326dfb70307008
x-forwarded-for: 111.97.111.36, 111.40.111.45:1088
x-waws-unencoded-url: "/adm/debug"
x-original-url: "/adm/debug"
x-arr-log-id: 9d39a48-a64370b-1b326dfb703-07008
x-forwarded-proto: https
content-type: application/json
content-length: '0'
params: {}
user:
email: example@example.com
kind: IAzureUserAttributes
service:
authorized_recipients:
- XXXBEN86A11Y755X
department_name: dept
organization_name: org
service_id: 9d39a48a64370b1b326dfb70307008
service_name: service
id: 9d39a48a64370b1b326dfb70307008-0000000000000000
version: 0
authorized_cidrs: []
kind: IRetrievedService
'401':
description: Unauthorized
description: An endpoint to debug POST requests to the API backend.
operationId: postDebug
summary: Debug POST
"/services":
post:
responses:
'200':
description: Service created.
schema:
"$ref": "#/definitions/Service"
examples:
application/json:
id: 2b3e728c1a5d1efa035c-0000000000000001
authorized_recipients:
- XXXYYY79A95Y000X
department_name: dept
organization_name: org
service_id: 2b3e728c1a5d1efa035c
service_name: service
version: 1
authorized_cidrs: []
'401':
description: Unauthorized
summary: Create Service
description: |-
Create a new Service with the attributes provided in the requst
payload.
operationId: createService
parameters:
- in: body
name: body
schema:
"$ref": "#/definitions/Service"
description: The Service payload.
x-examples:
application/json:
authorized_recipients:
- XXXYYY79A95Y000X
department_name: dept
organization_name: org
service_id: 2b3e728c1a5d1efa035c
service_name: service
authorized_cidrs: []
definitions:
#$ref: "https://raw.githubusercontent.com/teamdigitale/io-functions-commons/master/openapi/definitions.yaml"
AcceptedTosVersion:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/AcceptedTosVersion
BlockedInboxOrChannel:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/BlockedInboxOrChannel
BlockedInboxOrChannels:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/BlockedInboxOrChannels
CIDR:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/CIDR
CreatedMessageWithContent:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/CreatedMessageWithContent
CreatedMessageWithoutContent:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/CreatedMessageWithoutContent
CreatedMessageWithoutContentCollection:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/CreatedMessageWithoutContentCollection
DepartmentName:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/DepartmentName
EmailAddress:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/EmailAddress
ExtendedProfile:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ExtendedProfile
FiscalCode:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/FiscalCode
HttpStatusCode:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/HttpStatusCode
HttpsUrl:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/HttpsUrl
IsInboxEnabled:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/IsInboxEnabled
IsWebhookEnabled:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/IsWebhookEnabled
LimitedProfile:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/LimitedProfile
MaxAllowedPaymentAmount:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MaxAllowedPaymentAmount
MessageBodyMarkdown:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageBodyMarkdown
MessageContent:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageContent
MessageResponseNotificationStatus:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageResponseNotificationStatus
MessageResponseWithContent:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageResponseWithContent
MessageResponseWithoutContent:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageResponseWithoutContent
MessageStatus:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageStatus
MessageStatusValue:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageStatusValue
MessageSubject:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/MessageSubject
NewMessage:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/NewMessage
NewMessageDefaultAddresses:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/NewMessageDefaultAddresses
NotificationChannel:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/NotificationChannel
NotificationChannelStatus:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/NotificationChannelStatus
NotificationChannelStatusValue:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/NotificationChannelStatusValue
OrganizationFiscalCode:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/OrganizationFiscalCode
OrganizationName:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/OrganizationName
PaginatedCreatedMessageWithoutContentCollection:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PaginatedCreatedMessageWithoutContentCollection
PaginatedServiceTupleCollection:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PaginatedServiceTupleCollection
PaginationResponse:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PaginationResponse
PaymentAmount:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PaymentAmount
PaymentData:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PaymentData
PaymentNoticeNumber:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PaymentNoticeNumber
PreferredLanguage:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PreferredLanguage
PreferredLanguages:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/PreferredLanguages
ProblemJson:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ProblemJson
Profile:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/Profile
SenderMetadata:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/SenderMetadata
Service:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/Service
ServiceId:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ServiceId
ServiceName:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ServiceName
ServicePublic:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ServicePublic
ServiceTuple:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ServiceTuple
ServiceTupleCollection:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/ServiceTupleCollection
TimeToLiveSeconds:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/TimeToLiveSeconds
Timestamp:
$ref: https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions/Timestamp
responses: {}
parameters: {}
consumes:
- application/json
produces:
- application/json
securityDefinitions:
SubscriptionKey:
type: apiKey
name: Ocp-Apim-Subscription-Key
in: header
description: The API key obtained through the developer portal.
security:
- SubscriptionKey: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.