Skip to content

Delay throwing validation error #223

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

luolingchun
Copy link
Owner

Checklist:

  • Run pytest tests and no failed.
  • Run ruff check flask_openapi3 tests examples and no failed.
  • Run mypy flask_openapi3 and no failed.
  • Run mkdocs serve and no failed.

@puittenbroek I cannot verify the data afterwards, but I can delay throwing validation errors. Please leave any different solutions.

@luolingchun luolingchun force-pushed the Delay-throwing-validation-error branch from 8b1a9f6 to 59ad3f4 Compare May 10, 2025 04:01
@puittenbroek
Copy link

Hi @luolingchun, I will install this version in our application and see how that works out :) Thank you so far!

@puittenbroek
Copy link

puittenbroek commented May 16, 2025

Hi @luolingchun, I will install this version in our application and see how that works out :) Thank you so far!

This won't work, this will still call the func but then with arguments missing. Resulting in form or path (or others) arguments missing and python complaining about it. I made a pull request with a decorator here which will work much better; #226

PR isn't done, I know. But it is a proof of concept of what will work.

@luolingchun
Copy link
Owner Author

Your solution is a bit too complex. Can you paste a complete example to show the error you encountered?

@puittenbroek
Copy link

Your solution is a bit too complex. Can you paste a complete example to show the error you encountered?

Only because I made it backward compatible 😅

Looked at our errors again, think we can resolve them ourselves.

One is a path that has a specific enum, but not a deal breaker for me :)

class PopularItemsType(Enum):
    EVENTS = "events"
    TEAMS = "teams"


class PopularItemsTypePath(BaseModel):
    popularitems_type: PopularItemsType = Field(description="Type of the popular items")

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

Successfully merging this pull request may close these issues.

2 participants