Skip to content

Commit

Permalink
feat: create AsyncAPI 3.0.0 specification from template
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Dec 6, 2023
1 parent b37e20d commit affd9e4
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class CreateAsyncAPISpecification: CreateFileFromTemplateAction(
.setTitle("New API Specification")
.addKind("AsyncAPI 2 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI schema (yaml).yaml")
.addKind("AsyncAPI 2 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI schema (json).json")
.addKind("AsyncAPI 3 (.yaml)", Icons.ASYNCAPI_ICON, "AsyncAPI schema 3 (yaml).yaml")
.addKind("AsyncAPI 3 (.json)", Icons.ASYNCAPI_ICON, "AsyncAPI schema 3 (json).json")
}

override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?): String {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"asyncapi": "3.0.0",
"info": {
"title": "Account Service",
"version": "1.0.0",
"description": "This service is in charge of processing user signups :rocket:"
},
"channels": {
"userSignedup": {
"address": "user/signedup",
"messages": {
"userSignedupMessage": {
"\$ref": "#/components/messages/UserSignedUp"
}
}
}
},
"operations": {
"processUserSignups": {
"action": "receive",
"channel": {
"\$ref": "#/channels/userSignedup"
}
}
},
"components": {
"messages": {
"UserSignedUp": {
"payload": {
"type": "object",
"properties": {
"displayName": {
"type": "string",
"description": "Name of the user"
},
"email": {
"type": "string",
"format": "email",
"description": "Email of the user"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: "This service is in charge of processing user signups :rocket:"
channels:
userSignedup:
address: "user/signedup"
messages:
userSignedupMessage:
\$ref: "#/components/messages/UserSignedUp"
operations:
processUserSignups:
action: "receive"
channel:
\$ref: "#/channels/userSignedup"
components:
messages:
UserSignedUp:
payload:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user

0 comments on commit affd9e4

Please sign in to comment.