Skip to content

Instantly share code, notes, and snippets.

@bodiam
Created August 20, 2023 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bodiam/d770c451e5a67629135c46261b291eac to your computer and use it in GitHub Desktop.
Save bodiam/d770c451e5a67629135c46261b291eac to your computer and use it in GitHub Desktop.
openapi json
{
"openapi": "3.0.1",
"info": {
"title": "Apply Default Global SecurityScheme in springdoc-openapi",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:8080",
"description": "Generated server url"
}
],
"security": [
{
"apikey": []
}
],
"paths": {
"/mailboxes": {
"get": {
"tags": [
"mailbox-controller"
],
"operationId": "listAll",
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/MailboxResponse"
}
}
}
}
}
}
},
"post": {
"tags": [
"mailbox-controller"
],
"operationId": "createMailbox",
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/MailboxCreatedEvent"
}
}
}
}
}
}
},
"/account": {
"post": {
"tags": [
"account-controller"
],
"operationId": "register",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegisterUserCommand"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/AccountCreatedEvent"
}
}
}
}
}
}
},
"/mailboxes/{mailboxObjectId}": {
"get": {
"tags": [
"mailbox-controller"
],
"operationId": "listMailbox",
"parameters": [
{
"name": "mailboxObjectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EmailMessageSummaryResponse"
}
}
}
}
}
}
}
},
"/mailboxes/messages/{messageObjectId}": {
"get": {
"tags": [
"mailbox-controller"
],
"operationId": "getMessageByObjectId",
"parameters": [
{
"name": "messageObjectId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/EmailMessageResponse"
}
}
}
}
}
}
},
"/mailboxes/email/{emailAddress}": {
"get": {
"tags": [
"mailbox-controller"
],
"operationId": "listMailboxByEmail",
"parameters": [
{
"name": "emailAddress",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/EmailMessageSummaryResponse"
}
}
}
}
}
}
}
},
"/mailboxes/demo": {
"get": {
"tags": [
"mailbox-controller"
],
"operationId": "demo",
"parameters": [
{
"name": "color",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/demo/stream-sse-mvc": {
"get": {
"tags": [
"streaming-mailbox-controller"
],
"operationId": "streamSseMvc",
"parameters": [
{
"name": "timeout",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"format": "int64",
"default": 30000
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/SseEmitter"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"MailboxCreatedEvent": {
"required": [
"emailAddress",
"objectId"
],
"type": "object",
"properties": {
"objectId": {
"type": "string"
},
"emailAddress": {
"type": "string"
}
}
},
"RegisterUserCommand": {
"required": [
"email",
"name"
],
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string"
}
}
},
"AccountCreatedEvent": {
"required": [
"apiKey",
"objectId"
],
"type": "object",
"properties": {
"objectId": {
"type": "string"
},
"apiKey": {
"type": "string"
}
}
},
"MailboxResponse": {
"required": [
"emailAddress",
"objectId"
],
"type": "object",
"properties": {
"objectId": {
"type": "string"
},
"emailAddress": {
"type": "string"
}
}
},
"EmailMessageSummaryResponse": {
"required": [
"from",
"objectId",
"timestamp"
],
"type": "object",
"properties": {
"objectId": {
"type": "string"
},
"from": {
"type": "string"
},
"subject": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
},
"EmailMessageResponse": {
"required": [
"cc",
"from",
"objectId",
"timestamp",
"to"
],
"type": "object",
"properties": {
"objectId": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "array",
"items": {
"type": "string"
}
},
"from": {
"type": "string"
},
"cc": {
"type": "array",
"items": {
"type": "string"
}
},
"subject": {
"type": "string"
},
"body": {
"type": "string"
},
"mime": {
"type": "string"
}
}
},
"SseEmitter": {
"type": "object",
"properties": {
"timeout": {
"type": "integer",
"format": "int64"
}
}
}
},
"securitySchemes": {
"apikey": {
"type": "apiKey",
"name": "apikey",
"in": "query"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment