-
Notifications
You must be signed in to change notification settings - Fork 36
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
typing.Literal recognition is unsupported #91
Comments
typing.Literal
recognition is unsupported
hello @seppzer0 , thank you for your interest in this project 🙂 Indeed,
Do not hesitate to use links to plantuml.com UML samples. Also mind that I have limited time to maintain this project (I feel sorry for the number of issues that are waiting), I just cannot handle coding them all (even reviewing pull requests). |
Sure. Below is an example of Python code: class AssetsCommand(BaseModel):
codename: str
base: str
chroot: Literal["full", "minimal"]
clean_assets: bool
rom_only: bool
ksu: bool ...which in PlantUML format should be outputed as something like this:
Answered above.
If I understood this correctly, let's say we have Both usages can be recognized as essentially the same type, but I would say that if they are recognized as technically different types, it would be ok. Bear in mind that this is just my personal opinion, and I'm not sure if this can cause an issue in the future.
I would say definitely no. Once again I think that preserving the original type (even with different literal values order in it) is important. |
Thank you for your answers, with which I agree. I misunderstood the comparison between the literals and an enum; but leaving I cannot say if or when I could do that, reviewing pull requests would take me less time if you feel like giving it a try. |
Hi!
First of all, really liked the idea of the project. Auto-generating plantuml documentation straight from Python code is quite nice.
I've attempted to check out py2puml on my project, but happened to encounter this error:
I'm assuming py2puml is currently unable to recognize literals (which essentially are a form of enums), and based on this PR it also can't yet work with Pydantic models, which subjectively is even more concerning.
Is there a chance for the missing type (and potentially other types I haven't gotten an issue with yet) to be added to py2puml?
Again, really like the idea, can see myself using this very often if it works out :)
The text was updated successfully, but these errors were encountered: