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

Swagger UI does not submit HTTP request to API server #343

Closed
eecavanna opened this issue Oct 31, 2023 · 3 comments · Fixed by #344
Closed

Swagger UI does not submit HTTP request to API server #343

eecavanna opened this issue Oct 31, 2023 · 3 comments · Fixed by #344
Assignees
Labels
bug Something isn't working X SMALL Less than 1 day

Comments

@eecavanna
Copy link
Collaborator

At least for some endpoints (all that I've tried so far), Swagger UI is not submitting the HTTP request to the API server. Instead, an error about data validation is appearing in the JS console. Here's a screenshot showing the error.

image

Background:

  • nmdc-runtime was updated earlier today to use a version of FastAPI that works around yesterday's Swagger UI issue. As a result, that Swagger UI problem stopped affecting us and we were able to access previously-inaccessible sections of the Swagger UI. The web page isn't hanging anymore.
  • That nmdc-runtime update seems to have introduced this new issue (see introductory paragraph above) affecting Swagger UI usage.

More details are on Slack, at: https://nmdc-group.slack.com/archives/C05EFGHCYRH/p1698791445508619

@eecavanna eecavanna added bug Something isn't working X SMALL Less than 1 day labels Oct 31, 2023
@eecavanna eecavanna self-assigned this Oct 31, 2023
@eecavanna
Copy link
Collaborator Author

While creating this Issue, I wanted to cite a version number of nmdc-runtime. Since it currently doesn't have version numbers (see related ticket), I will cite the commit hash instead.

Here's the commit hash where this issue is present: f097bdd

@dwinston
Copy link
Collaborator

dwinston commented Nov 1, 2023

I suspect this is an outcome of point 9 from #337 (comment). That is, a pydantic field specification like filter: Optional[str] no longer means a field is optional. For pydantic V2, one needs to specify e.g. filter: Optional[str] = None. The first form now (in pydantic V2) seems to mean "this field is required, and its value may be a str or the value None".

@dwinston
Copy link
Collaborator

dwinston commented Nov 1, 2023

I will first try to use the bump-pydantic tool to migrate, i.e. close #339. If this exercise proves nontrivial, I will revert to 46d6543 and try to pin fastapi as fastapi>=0.104.1 and also pin pydantic as pydantic<2.0.0.

dwinston added a commit that referenced this issue Nov 1, 2023
dwinston added a commit that referenced this issue Nov 1, 2023
dwinston added a commit that referenced this issue Nov 1, 2023
* fix: run `bump-pydantic nmdc_runtime` and apply

closes #339

addresses #343

* fix: @model_validator refactor

closes #343
dwinston added a commit that referenced this issue Nov 3, 2023
* fix: run `bump-pydantic nmdc_runtime` and apply

closes #339

addresses #343

* fix: @model_validator refactor

closes #343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working X SMALL Less than 1 day
Projects
No open projects
2 participants