sakethsomaraju commented on issue #68065:
URL: https://github.com/apache/airflow/issues/68065#issuecomment-4645284427

   Tested in `Airflow 3.1.8`
   
   Issue with the leading slash still remains unfixed.
   
   <img width="1651" height="237" alt="Image" 
src="https://github.com/user-attachments/assets/933d1d55-a8cc-40d4-a810-a7257c3174aa";
 />
   
   ```
   curl --location --request PATCH 
'https://BASE_DOMIAN/api/v2/variables/%2Ffoo' \
   --header 'Content-Type: application/json' \
   --header 'Authorization: Bearer eyJ-----REDACTED-----M2hw' \
   --data '{
     "key": "/foo",
     "value": "bar"
   }'
   ```
   
   Response:
   `404`
   ```
   {
       "detail": "The Variable with key: `foo` was not found"
   }
   ```
   ----
   https://github.com/apache/airflow/issues/50796 handles if the variable key 
contains the `/` (slash) inside the key (not a leading slash)
   
   <img width="1632" height="385" alt="Image" 
src="https://github.com/user-attachments/assets/45b7bbf3-cb8d-4206-ae3c-a81e2b703209";
 />
   
   ```
   curl --location --request PATCH 
'https://BASE_DOMAIN/api/v2/variables/foo%2Fbar' \
   --header 'Content-Type: application/json' \
   --header 'Authorization: Bearer eyJ ---- REDACTED ----- M2hw' \
   --data '{
     "key": "foo/bar",
     "value": "bar"
   }'
   ```
   Response:
   `200`
   ```
   {
       "key": "foo/bar",
       "value": "123",
       "description": null,
       "is_encrypted": true
   }
   ```


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

Reply via email to