From 35c62196500779bafd356ff745dceffc07810ecb Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Fri, 13 Apr 2018 14:36:12 +0530 Subject: [PATCH] swagger api changes for new bus payload format and v5 endpoint change. --- .gitignore | 1 + docs/swagger.yaml | 67 ++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c2658d7..940d56a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +dist diff --git a/docs/swagger.yaml b/docs/swagger.yaml index b586b2b..a0668e1 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -6,7 +6,7 @@ info: title: "bus-api" contact: {} host: "localhost:3000" -basePath: "/api/v1" +basePath: "/v5/bus" schemes: - "https" consumes: @@ -30,18 +30,41 @@ paths: schema: type: "object" required: - - "message" - - "type" + - "topic" + - "originator" + - "timestamp" + - "mime-type" + - "payload" properties: - type: + topic: type: "string" - description: "the event type, should be a dot separated fully qualitied\ + description: "topic name should be a dot separated fully qualified\ + \ name i.e. domain.type.operation" + example: "notifications.action.email.project.topic.created" + originator: + type: "string" + description: "service repository name, from where message is published" + example: "tc-notifications" + timestamp: + type: "string" + description: "ISO 8601 timestamp at which message is published.\ \ name" - example: "notifications.connect.project.update" - message: + example: "2018-04-13T00:00:00" + mime-type: type: "string" - description: "the message, should be a JSON formatted string" - example: "{ \\\"test\\\": \\\"test-value\\\" }" + description: "mime-type for 'payload'" + example: "application/json" + payload: + type: "object" + description: "actual payload depending on mime-type for consumer" + example: + data: + subject: "project topic created" + name: "xyz" + recipients: + - "tc@mailinator.com" + - "tc2@mailinator.com" + replyTo: "" responses: 204: description: "OK" @@ -87,6 +110,32 @@ paths: description: "internal server error" schema: $ref: "#/definitions/Error" + /placeholders: + delete: + tags: + - "placeholders" + summary: "clear cache for placefolder" + description: "clear the cache for placefolder validation for email topics." + parameters: [] + responses: + 200: + description: "OK" + schema: + type: "array" + items: + type: "string" + 401: + description: "missing, invalid, or expired token" + schema: + $ref: "#/definitions/Error" + 403: + description: "the calling service is not allowed" + schema: + $ref: "#/definitions/Error" + 500: + description: "internal server error" + schema: + $ref: "#/definitions/Error" securityDefinitions: Bearer: type: "apiKey"