Project

Profile

Help

Issue #9425

Updated by daviddavis over 2 years ago

For the pulp_file ACS refresh endpoint, we started using returning a `TaskGroupResponse`: 

 ```json 
         "{file_file_alternate_content_source_href}refresh/": { 
             "post": { 
                 "description": "Trigger an asynchronous task to create Alternate Content Source content.", 
                 "operationId": "acs_file_file_refresh", 
                 "parameters": [ 
                     { 
                         "in": "path", 
                         "name": "file_file_alternate_content_source_href", 
                         "required": true, 
                         "schema": { 
                             "type": "string" 
                         } 
                     } 
                 ], 
                 "responses": { 
                     "202": { 
                         "content": { 
                             "application/json": { 
                                 "schema": { 
                                     "$ref": "#/components/schemas/TaskGroupResponse" 
                                 } 
                             } 
                       } 
                 } 
 ``` 

 In the schema, this defines `TaskGroupResponse` as such: 

 ```json 
             "TaskGroupResponse": { 
                 "description": "Serializer for asynchronous operations that return a task group.", 
                 "properties": { 
                     "task_group": { 
                         "description": "The href of the task group.", 
                         "format": "uri", 
                         "type": "string" 
                     } 
                 }, 
                 "required": [ 
                     "task_group" 
                 ], 
                 "type": "object" 
             }, 
 ``` 

 For the bindings, this generates a `TaskGroupResponse` in `pulpcore/client/pulp_file/models/task_group_response.py`. 

 The problem comes about when you try to use `TaskGroupResponse` for a core endpoint. This is because there's already a `TaskGroupResponse` defined in `pulpcore/client/pulpcore/models/task_group_response.py`. 

 It's being used by the task_groups_read endpoint: 

 ```json 
         "{task_group_href}": { 
             "get": { 
                 "operationId": "task_groups_read", 
                 "parameters": [ 
                     { 
                         "in": "path", 
                         "name": "task_group_href", 
                         "required": true, 
                         "schema": { 
                             "type": "string" 
                         } 
                     }, 
                     { 
                         "description": "A list of fields to include in the response.", 
                         "in": "query", 
                         "name": "fields", 
                         "schema": { 
                             "type": "string" 
                         } 
                     }, 
                     { 
                         "description": "A list of fields to exclude from the response.", 
                         "in": "query", 
                         "name": "exclude_fields", 
                         "schema": { 
                             "type": "string" 
                         } 
                     } 
                 ], 
                 "responses": { 
                     "200": { 
                         "content": { 
                             "application/json": { 
                                 "schema": { 
                                     "$ref": "#/components/schemas/TaskGroupResponse" 
                                 } 
                             } 
                         }, 
                         "description": "" 
                     } 
                 }, 
                 "summary": "Inspect a task group", 
                 "tags": [ 
                     "Task-Groups" 
                 ] 
             } 
 ``` 

Back