Created
May 6, 2024 14:52
-
-
Save TharmiganK/9fb5e61220fafd7bb6a42173b24efb51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.1", | |
"info": { | |
"title": "Text Processing", | |
"version": "0.1.0" | |
}, | |
"servers": [ | |
{ | |
"url": "{server}:{port}/text-processing", | |
"variables": { | |
"server": { | |
"default": "http://localhost" | |
}, | |
"port": { | |
"default": "9098" | |
} | |
} | |
} | |
], | |
"paths": { | |
"/api/sentiment": { | |
"post": { | |
"operationId": "postApiSentiment", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Post" | |
} | |
} | |
}, | |
"required": true | |
}, | |
"responses": { | |
"200": { | |
"description": "Ok", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/Sentiment" | |
} | |
} | |
} | |
}, | |
"400": { | |
"description": "BadRequest", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/ErrorPayload" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"ErrorPayload": { | |
"required": [ | |
"message", | |
"method", | |
"path", | |
"reason", | |
"status", | |
"timestamp" | |
], | |
"type": "object", | |
"properties": { | |
"timestamp": { | |
"type": "string" | |
}, | |
"status": { | |
"type": "integer", | |
"format": "int64" | |
}, | |
"reason": { | |
"type": "string" | |
}, | |
"message": { | |
"type": "string" | |
}, | |
"path": { | |
"type": "string" | |
}, | |
"method": { | |
"type": "string" | |
} | |
} | |
}, | |
"Post": { | |
"required": [ | |
"text" | |
], | |
"type": "object", | |
"properties": { | |
"text": { | |
"type": "string" | |
} | |
} | |
}, | |
"Probability": { | |
"required": [ | |
"neg", | |
"neutral", | |
"pos" | |
], | |
"type": "object", | |
"properties": { | |
"neg": { | |
"type": "number", | |
"format": "double" | |
}, | |
"neutral": { | |
"type": "number", | |
"format": "double" | |
}, | |
"pos": { | |
"type": "number", | |
"format": "double" | |
} | |
} | |
}, | |
"Sentiment": { | |
"required": [ | |
"label", | |
"probability" | |
], | |
"type": "object", | |
"properties": { | |
"probability": { | |
"$ref": "#/components/schemas/Probability" | |
}, | |
"label": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment