diff --git a/api_docs_openapi.yaml b/api_docs_openapi.yaml new file mode 100644 index 0000000..2199316 --- /dev/null +++ b/api_docs_openapi.yaml @@ -0,0 +1,438 @@ +openapi: 3.0.0 +info: + title: Case API V2 + description: All the APIs are related to Case Attributes. + termsOfService: "" + version: '2.0' +servers: + - url: '${SERVER_URL}' + +paths: + /articlesByReleaseDate/{articleReleaseDate}/: + parameters: + - in: path + name: articleReleaseDate + schema: + type: string + format: date-time + minLength: 10 + maxLength: 10 + nullable: false + examples: + HTTP200-ValidDate: + summary: ValidArticleReleaseDate + value: "2022-09-04" + HTTP404-InvalidReleaseDate: + summary: InvalidReleaseDate + value: "2022 09 04" + HTTP404-NoResultsFoundForReleaseDate: + summary: NoResultsFoundForReleaseDate + value: "2025-09-04" + required: true + description: Retrieve the articles released on specified releaseDate. + get: + security: + - bearerAuth: [ ] + operationId: getArticlesByReleaseDate + tags: + - Python web scrapping APIs + summary: Get all articles for given date. + description: Gives all the parsed articles from python blogs for a given date. + parameters: + - in: query + name: pageNumber + schema: + type: integer + examples: + HTTP200-ValidDate: + summary: ValidPageNumber + value: 1 + HTTP404-InvalidReleaseDate: + summary: InvalidPageNumber + value: 2.5 + HTTP404-NoResultsFoundForReleaseDate: + summary: PageNumberNotFound + value: 2000 + description: Query parameter specifying the page number of the search results to be retrieved. + responses: + '200': + content: + application/json: + examples: + ValidDate: + $ref: "#/components/examples/GetArticlesByReleaseDate" + schema: + $ref: '#/components/schemas/ArticlesByReleaseDate' + description: The request is received. + '400': + content: + application/json: + examples: + InvalidReleaseDate: + $ref: '#/components/examples/InvalidReleaseDate' + schema: + $ref: "#/components/schemas/Exception" + description: Invalid Release Date. + '404': + content: + application/json: + examples: + NoResultsFoundForReleaseDate: + $ref: '#/components/examples/NoResultsFoundForReleaseDate' + schema: + $ref: "#/components/schemas/Exception" + description: Resource Not Found. + + /extractArticlesByReleaseDate/: + post: + security: + - bearerAuth: [ ] + operationId: postArticlesByReleaseDate + tags: + - Python web scrapping APIs + summary: Extractor all articles for given date. + description: Extracts python blogs for a given date. + parameters: + - in: query + name: articleReleaseStartDate + schema: + type: string + format: date-time + minLength: 10 + maxLength: 10 + nullable: false + examples: + HTTP200-ValidDate: + summary: ValidArticleReleaseDate + value: "2022-09-04" + HTTP404-InvalidReleaseDate: + summary: InvalidReleaseDate + value: "2022 09 04" + HTTP404-NoResultsFoundForReleaseDate: + summary: NoResultsFoundForReleaseDate + value: "2025-09-04" + required: true + description: Retrieve the articles released from specified releaseDate. + - in: query + name: articleReleaseEndDate + schema: + type: string + format: date-time + minLength: 10 + maxLength: 10 + nullable: false + examples: + HTTP200-ValidDate: + summary: ValidArticleReleaseDate + value: "2022-09-04" + HTTP404-InvalidReleaseDate: + summary: InvalidReleaseDate + value: "2022 09 04" + HTTP404-NoResultsFoundForReleaseDate: + summary: NoResultsFoundForReleaseDate + value: "2025-09-04" + required: true + description: Retrieve the articles released till specified releaseDate. + responses: + '200': + content: + application/json: + examples: + ValidDate: + $ref: "#/components/examples/ArticleByReleaseDateRequest" + schema: + $ref: '#/components/schemas/ExtractArticleByReleaseDateRequest' + description: The request is received. + '400': + content: + application/json: + examples: + InvalidReleaseDate: + $ref: '#/components/examples/InvalidReleaseDate' + schema: + $ref: "#/components/schemas/Exception" + description: Invalid Release Date. + + /extractArticlesByReleaseDate/{extractionRequestId}/: + parameters: + - in: path + name: extractionRequestId + schema: + type: string + minLength: 12 + maxLength: 12 + nullable: false + examples: + HTTP200-ValidDate: + summary: ValidArticleReleaseDate + value: "ARDR11223422" + HTTP404-InvalidReleaseDate: + summary: InvalidReleaseDate + value: "ARDR112234224455" + HTTP404-NoResultsFoundForReleaseDate: + summary: NoResultsFoundForReleaseDate + value: "ARDR00000000" + required: true + description: Get status of fetch article by release date request. + get: + security: + - bearerAuth: [ ] + operationId: getArticleByReleaseDateRequest + tags: + - Python web scrapping APIs + summary: Get status of fetch article by release date request. + description: Get status of fetch article by release date request. + parameters: [] + responses: + '200': + content: + application/json: + examples: + ValidDate: + $ref: "#/components/examples/ExtractArticleByReleaseDateRequest" + schema: + $ref: '#/components/schemas/ExtractArticleByReleaseDateRequest' + description: The request is received. + '400': + content: + application/json: + examples: + InvalidReleaseDate: + $ref: '#/components/examples/InvalidExtractionRequestId' + schema: + $ref: "#/components/schemas/Exception" + description: Invalid Release Date. + '404': + content: + application/json: + examples: + NoResultsFoundForReleaseDate: + $ref: '#/components/examples/NoResultsFoundForExtractionRequestId' + schema: + $ref: "#/components/schemas/Exception" + description: Resource Not Found. + + +tags: + - name: Python web scrapping APIs + description: "Python web scrapping APIs" + +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # for documentation purposes only + + examples: + ExtractArticleByReleaseDateRequest: + value: + object: ExtractArticleByReleaseDateRequest + extractionRequestId: ARDR11223422 + status: "IN PROGRESS" + + GetArticlesByReleaseDate: + value: + object: ArticlesByReleaseDate + articleReleaseDate: 2022-09-04 + articlesByReleaseDateArray: + - object: Article + title: "Python 3.13.0 alpha 1 is now available" + releaseDate: 2022-09-04 + author: "Thomas Wouter" + blogTime: "8:31 AM" + ReleaseDate: 2022-09-04 + nextPageAPI: null + totalPages: 1 + totalCount: 1 + + InvalidReleaseDate: + value: + object: Exception + code: UN400 + message: INVALID_INPUT + details: Requested articleReleaseDate is invalid. + + NoResultsFoundForReleaseDate: + value: + object: Exception + code: UN404 + message: RESOURCE_NOT_FOUND + details: No articles found for requested articleReleaseDate. + + InvalidExtractionRequestId: + value: + object: Exception + code: UN400 + message: INVALID_INPUT + details: Requested extractionRequestId is invalid. + + NoResultsFoundForExtractionRequestId: + value: + object: Exception + code: UN404 + message: RESOURCE_NOT_FOUND + details: No request found for requested extractionRequestId. + + schemas: + ArticlesByReleaseDate: + type: object + properties: + object: + type: string + description: "Array of articles posted on given date" + default: ArticlesByReleaseDate + minLength: 14 + maxLength: 14 + nullable: false + articleReleaseDate: + type: string + format: date-time + minLength: 10 + maxLength: 10 + example: 2022-09-04 + nullable: false + articlesByReleaseDateArray: + type: array + items: + $ref: '#/components/schemas/Article' + nextPageAPI: + description: Link to next page of the ArticlesByReleaseDate Results. + example: ${SERVER_URL}/articlesByReleaseDate/2022-02-01/?pageNumber=2 + type: string + maxLength: 255 + nullable: true + totalPages: + description: Total number of pages to obtain all the objects of the ArticlesByReleaseDate Results. + example: 3 + type: integer + totalCount: + description: Total number of records available for this Search. + example: 125 + type: integer + required: + - object + - articleReleaseDate + - articlesByReleaseDateArray + - nextPageAPI + - totalPages + - totalCount + + Article: + title: Article + type: object + nullable: true + properties: + object: + type: string + description: Name of the object + default: Article + minLength: 7 + maxLength: 7 + nullable: false + title: + type: string + minLength: 3 + maxLength: 200 + nullable: false + example: "Python 3.13.0 alpha 1 is now available" + releaseDate: + type: string + format: date-time + minLength: 10 + maxLength: 10 + example: 2022-09-04 + nullable: false + author: + type: string + minLength: 3 + maxLength: 50 + example: "Thomas Wouter" + nullable: false + blogTime: + type: string + minLength: 7 + maxLength: 8 + example: "8:31 AM" + nullable: true + createdDate: + type: string + format: date-time + minLength: 10 + maxLength: 10 + example: 2022-09-04 + nullable: false + required: + - object + - title + - releaseDate + - author + - blogTime + - createdDate + + Exception: + title: Exception + type: object + description: Exception object contains specific error code and its message related to the API request validation error or error occurred during API request processing. + nullable: true + properties: + object: + type: string + example: Exception + default: Exception + minLength: 9 + maxLength: 9 + nullable: false + code: + type: string + description: Indicates the type of error occurred. + minLength: 1 + maxLength: 75 + nullable: false + message: + type: string + description: Indicates the error message that describes the error code. + minLength: 1 + maxLength: 255 + nullable: false + details: + type: string + description: Describes what went wrong. + minLength: 1 + maxLength: 255 + nullable: false + required: + - object + - code + - message + - details + + ExtractArticleByReleaseDateRequest: + title: Article By Release Date Request + type: object + description: Extraction request was received. + nullable: false + properties: + object: + type: string + default: ExtractArticleByReleaseDateRequest + minLength: 34 + maxLength: 34 + nullable: false + extractionRequestId: + type: string + description: Unique Request ID + minLength: 13 + maxLength: 12 + example: ARDR11223422 + nullable: false + status: + type: string + enum: [ 'IN PROGRESS', 'COMPLETED', "FAILED" ] + description: Current status of request. + example: 'IN PROGRESS' + nullable: false + required: + - object + - extractionRequestId + - status