You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/13 07:59:04 UTC

[GitHub] [airflow] mik-laj commented on pull request #9273: implement api v1 for variables

mik-laj commented on pull request #9273:
URL: https://github.com/apache/airflow/pull/9273#issuecomment-643587896


   > I think the key in request body is redundant, should we update the api spec to remove it?
   
   The structure of this request body results from the fact that it is based on the Variable schema.
   ```yaml
       VariableCollectionItem:
         # Divided into two schemas for sensitive data protection
         type: object
         properties:
           key:
             type: string
   
       VariableCollection:
         type: object
         properties:
           variables:
             type: array
             items:
               $ref: '#/components/schemas/VariableCollectionItem'
   
       Variable:
         allOf:
           - $ref: '#/components/schemas/VariableCollectionItem'
           - type: object
             properties:
               value:
                 type: string
   ```
   The same schema is used to create as well as edit elements, so both fields must exist. We can create a new scheem that will not contain this one field, but it will complicate the API.
   
   This field should be immutable, which is well described in the AIP.
   
   > When a service receives an immutable field in an update request (or similar), even if included in the update mask, the service should ignore the field if the value matches, but should error with INVALID_ARGUMENT if a change is requested.
   
   https://google.aip.dev/203
   
   Unfortunately, OpenAPI has no support for immutable fields, so we have some confusion in the specification definition. I think we can add an additional description to explain this.
   
   What do you think about it?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org