OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Redoc calls are not working for Patch APIs

Open darth-coder00 opened this issue 5 years ago • 4 comments

Facing issue in 2 APIs

  1. Add Follower api for Pipeline
  2. Patch API for Pipeline

I tried to sign in and create new user, then in non-secure mode from api docs I tried to add follower in pipeline, It's giving this error

{
"code": 404,
"message": "User instance for \"9f9188d5-931f-40c4-a171-b3e12c5255f6\" not found"
}

I can get user from get user api with above id

For Patch api, with Request data as

[{op: "replace",path: "/description",value: "Hive ETL3 pipelines"}]

It gives 405 - Method not allowed Ownership is set to 9f9188d5-931f-40c4-a171-b3e12c5255f6

Also, Is there some Documentation error with Put api in pipelines? Unable to see id field here Screenshot 2021-10-04 at 9 56 45 PM

darth-coder00 avatar Oct 04 '21 17:10 darth-coder00

@darth-coder00 this is an issue with how our docs are sending a request image you can see the userId being double wrapped with double quotes cc @shahsank3t

harshach avatar Oct 04 '21 21:10 harshach

Tried with curl image

curl -X PUT -H "Content-Type: application/json" -d '2d0411d4-d56c-4115-ac46-53e5a3084b04' http://localhost:8585/api/v1/pipelines/4ac1f901-9af0-4eae-9bfa-cf8056af09a9/followers          
{"id":"4ac1f901-9af0-4eae-9bfa-cf8056af09a9","name":"hive_etl","displayName":"Hive ETL","fullyQualifiedName":"sample_airflow.hive_etl","description":"Hive ETL pipeline","pipelineUrl":"http://localhost:8080/tree?dag_id=hive_etl","followers":[{"id":"2d0411d4-d56c-4115-ac46-53e5a3084b04","type":"user","name":"aaron_freeman7"}]}

harshach avatar Oct 04 '21 22:10 harshach

Same with patch curl -X PATCH -H "Content-type: application/json-patch+json" http://localhost:8585/api/v1/pipelines/94f8bb02-e8cc-44b1-8dc5-d13d0f8b8d8d --data '[{"op": "replace","path": "/description","value": "Hive ETL3 pipelines"}]' Response

{"id":"94f8bb02-e8cc-44b1-8dc5-d13d0f8b8d8d","name":"presto_etl","displayName":"Presto ETL","fullyQualifiedName":"sample_airflow.presto_etl","description":"Hive ETL3 pipelines","pipelineUrl":"http://localhost:8080/tree?dag_id=presto_etl","tasks":[{"id":"34d6d58b-48c0-4e02-8d55-aeba61fe2373","type":"task","name":"sample_airflow.presto_task","description":"Airflow operator to perform ETL on presto tables","href":"http://localhost:8585/api/v1/tasks/34d6d58b-48c0-4e02-8d55-aeba61fe2373"},{"id":"d083f916-8122-4f49-a66b-6108c6083349","type":"task","name":"sample_airflow.assert_table_exists","description":"Assert if a table exists","href":"http://localhost:8585/api/v1/tasks/d083f916-8122-4f49-a66b-6108c6083349"}],"tags":[],"href":"http://localhost:8585/api/v1/pipelines/94f8bb02-e8cc-44b1-8dc5-d13d0f8b8d8d","service":{"id":"9f0c6496-f266-4528-90e7-8f7ed4a0a527","type":"pipelineService","name":"sample_airflow","description":"Airflow service","href":"http://localhost:8585/api/v1/services/pipelineServices/9f0c6496-f266-4528-90e7-8f7ed4a0a527"}}```

harshach avatar Oct 04 '21 22:10 harshach

it doesn't look like we are setting -H "Content-type: application/json-patch+json" properly and also the json structure we are passing is not right @shahsank3t can we go through all the APIs and make sure the examples are correct and they are working

harshach avatar Oct 04 '21 22:10 harshach