Skip to content

Swagger UI compatibility #37

@mustberuss

Description

@mustberuss

I reverse engineered the Swagger UI json object for the api. The problem I'm having is that the X-Status-Reason response header is not being displayed in the ui when appropriate. I stood up a copy of the service and added the code below to querymodule/app/routes/query.php to expose the response header. Could this code be added to api and would you care to add the json object and Swagger UI to patentsview.org? I shouldn't be the only one using Swagger UI to learn the ins and outs of the api!

// Set allows headers on Options requests to keep browsers happy, especially if the browser is displaying Swagger UI
$app->options(
   '/api/:endpoint/query',
   function () use ($app) {
       $app->response()->header('Access-Control-Allow-Origin', '*');
       $app->response()->header('Access-Control-Allow-Headers', 'origin, content-type, accept');
       $app->response()->header('Access-Control-Allow-Methods','GET, PUT, POST, DELETE, OPTIONS');  
       $app->response()->header('Access-Control-Expose-Headers','X-Status-Reason');
   }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions