Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Hakureiremu opened this issue May 10, 2024 · 0 comments
Open

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

Hakureiremu opened this issue May 10, 2024 · 0 comments

Comments

@Hakureiremu
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant