Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OpenAPI validation and only use updateable fields in request body for PATCH endpoints of DAG and Variable. #14645

Closed

Conversation

ephraimbuddy
Copy link
Contributor

Closes: #14635
This two endpoints DAG PATCH and Variable PATCH allows only a single field to be updated and were being given the DAG and Variable objects in the requestBody respectively. This causes confusion and I feel we should let users know that they don't need the DAG or Variable object for their updates

This PR changes the behaviour and also switch to using Openapi for validation in the requestBody instead of schema validation


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Mar 6, 2021
@@ -425,7 +425,12 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/DAG'
type: object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should named components here. Otherwise there may be problems with generating classes for API client

I personally prefer to always use named components.

@mik-laj
Copy link
Member

mik-laj commented Mar 6, 2021

I don't understand this change. according to the OpenAPI specification, these fields should never be sent. See: spec-first/connexion#942

we should fix clients which don't respect OpenAPI specs, not make changes to our API specs.

@mik-laj
Copy link
Member

mik-laj commented Mar 6, 2021

I am still not convinced that this change is a good idea. Especially in strongly typed languages like Java, this means that we will have several kinds of objects. This does not follow the REST convention. The REST convention limits the number of different types of objects for different operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UpdateMask is useless for POST/PATCH if readOnly=true in the openapi specs
2 participants