Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.

removed tuples from all route parameters and base model definitions#12

Merged
rosesyrett merged 1 commit into
masterfrom
removeTypingTuple
Aug 18, 2022
Merged

removed tuples from all route parameters and base model definitions#12
rosesyrett merged 1 commit into
masterfrom
removeTypingTuple

Conversation

@rosesyrett
Copy link
Copy Markdown
Contributor

This PR is necessary because currently fastAPI does not support typing.Tuples. In order to work around this, I redefined my pydantic models to instead use other pydantic models (essentially, dataclasses) with explicit members. Where this was not possible (e.g. routes/hkl, for the scan_hkl route), I added errors to catch incorrect parameters instead.

This is part of a larger work to make swagger-codegen outputs for a java client better - Tuples are not correctly translated to an openapi schema.

Copy link
Copy Markdown
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@rosesyrett rosesyrett merged commit 93d6ef7 into master Aug 18, 2022
@rosesyrett rosesyrett deleted the removeTypingTuple branch August 18, 2022 15:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants