Skip to content

How could I add an API via the generator? #150

Description

@Hakureiremu

I hope to add some new APIs for this project but faced some problems during using the generator part. I have studied the guidance of adding APIs via making API describing configuration, while I'm more interested in the generator function mentioned in the paper.
I use the harvardartmuseum(HVM) API as a test for the generator.
As described in its API's documentation, the apikey is filled in Query Params. I successfully constructed my request and got correct response using Postman, while problems arose when I used the generator to send a sample request.
Initially, in the 3rd box(Authorization), I selected QueryParam as authentication option, and filled the key-value pair with apikey:content of my apikey. However, error message noted me that there is a KeyError in ui.py as the figure below.
image
I thought client_id and client_secret are not required for accessing HVM API, and this error seemed like a delete of an empty key in a dictionary, so I tried two methods to bypass this error.
First I tried to comment that part of the code locally, but the error still exists.
image
Second I tried to give these 3 keys a default value, but it arose more errors in pydantic package. I think these fields might be compulsory for this framework.
Moreover, if I tried to choose "No Authorization" option and write the query pair apikey:content of my apikey into the 2nd box. The generator normally return Unauthorized as I think.
image
So I want to ask how to fill the 3 fields in Authorization box: client_id, client_secret and access_token if I want to use generator to send sample requests to generate api configuration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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