shubhamraj-git commented on code in PR #46042:
URL: https://github.com/apache/airflow/pull/46042#discussion_r1931546366
##########
airflow/api_fastapi/core_api/openapi/v1-generated.yaml:
##########
@@ -4457,6 +4457,74 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
+ post:
+ tags:
+ - XCom
+ summary: Create Xcom Entry
+ description: Create an XCom entry.
+ operationId: create_xcom_entry
+ parameters:
+ - name: dag_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Dag Id
+ - name: task_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Task Id
+ - name: dag_run_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Dag Run Id
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/XComCreateRequest'
+ responses:
+ '201':
+ description: Successful Response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/XComCreateResponse'
+ '401':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HTTPExceptionResponse'
+ description: Unauthorized
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HTTPExceptionResponse'
+ description: Forbidden
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HTTPExceptionResponse'
+ description: Bad Request
+ '404':
Review Comment:
400 we usually have, If the entity is syntactically invalid or doesn't meet
our validation rules, and 404 if entity must already exist on the server, and
we cannot process the request because that entity is not found.
Here, Dag ID and task ID has to be already present.
But one angle to this, using` 404 Not Found` in a POST API may feel
unconventional at first glance, as 404 is traditionally associated with
"retrieval" operations (GET) where a resource doesn't exist. I am open to use
400.
@pankajastro @rawwar please let me know what do you think about this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]