API Client response code not found in API Docs
search cancel

API Client response code not found in API Docs

book

Article ID: 283097

calendar_today

Updated On:

Products

Insights DX OpenExplore Observability

Issue/Introduction

Default Swagger configuration json does not have all possible response codes. When a response code is not mapped, a generic message such as "response code not found in API docs" is returned instead. 

Cause

Swagger/Open API specification wavefront_swagger.json file is not coded with the response codes sent by the REST API.

Resolution

While support will provide best-efforts to answer your questions, we do not support custom GO Swagger or custom API client.

Building a custom GO client requires development of the json file to handle all possible responses.

  1. Start with the default swagger-config.json
  2. Map additional response codes so that your GO client has instructions to handle expected responses including, but not limited to; no permissions, object not found, ect.
  3. To confirm if the error is with the backend API server or the GO client.
    1. Run the same query through the supported API Documents page within the DX OpenExplore UI.
    2. If successful review your local GO client for updates
    3. If our API also returns the error please open a support ticket for investigation.

Example:   POST /api/v2/usergroup (Create a specific user Group)

Test A)  UI - API Documentation, POST ran by a User Account that does not have Permission to create the userGroup, results returned.

Error code 401
Code Details: 401 Error: response status is 401
Undocumented
Response body: You are trying to perform sensitive operation, password reprompt is needed.

Test B) Custom GO Client,  POST API call by same user that does not have permissions AND the GO Swagger does not a mapping to handle this response. 

"response code not found in API docs" the GO client default to the "not found" message.

Additional Information