Skip to content

Instantly share code, notes, and snippets.

@valmoz
Created August 18, 2021 11:38
Show Gist options
  • Save valmoz/16503c5ce996d27982722959733b6955 to your computer and use it in GitHub Desktop.
Save valmoz/16503c5ce996d27982722959733b6955 to your computer and use it in GitHub Desktop.
OpenApi with external files
openapi: 3.0.3
info:
title: Example API v2 - API Reference
description: ""
contact:
name: Fatture in Cloud
url: 'https://www.example.it'
email: info@example.it
license:
name: ''
url: 'https://www.example.it'
version: v2.0.0
servers:
- url: 'https://api-v2.example.it'
tags:
- name: User
paths:
/user/info:
get:
tags:
- User
summary: Get User Info
responses:
'200':
$ref: '#/components/responses/UserInfoResponse'
'401':
description: Unauthorized.
operationId: getUserInfo
description: "Makes possible to retrieve the current user's info."
security:
- OAuth2AuthenticationCodeFlow: []
parameters: []
components:
schemas: {}
securitySchemes:
OAuth2AuthenticationCodeFlow:
type: oauth2
flows:
authorizationCode:
tokenUrl: 'https://api-v2.example.it/oauth/token'
refreshUrl: 'https://api-v2.example.it/oauth/token'
scopes:
'entity.clients:r': ''
authorizationUrl: 'https://api-v2.example.it/oauth/authorize'
responses:
UserInfoResponse:
description: User info.
content:
application/json:
schema:
$ref: ./models/responses/UserInfoResponse.yaml
security:
- OAuth2AuthenticationCodeFlow: []
type: object
description: User infos.
properties:
id:
type: integer
example: 12345
description: User unique identifier
name:
type: string
description: Full name of the user.
nullable: true
example: Mario Rossi
first_name:
type: string
nullable: true
example: Mario
description: First name of the user.
last_name:
type: string
nullable: true
example: Rossi
description: Last name of the user.
email:
type: string
example: mario.rossi@example.com
description: Email of the user.
hash:
type: string
example: 5add29e1234532a1bf2ed7b612043029
picture:
type: string
nullable: true
example: picture.jpg
description: Picture of the user.
description: The UserInfo response.
type: object
properties:
data:
$ref: ../schemas/User.yaml
info:
type: object
properties:
need_marketing_consents_confirmation:
type: boolean
need_password_change:
type: boolean
need_terms_of_service_confirmation:
type: boolean
email_confirmation_state:
type: object
properties:
need_confirmation:
type: boolean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment