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

Improve api docs representation of LiteralUnions #795

Closed
ST-DDT opened this issue Apr 7, 2022 · 1 comment · Fixed by #811
Closed

Improve api docs representation of LiteralUnions #795

ST-DDT opened this issue Apr 7, 2022 · 1 comment · Fixed by #811
Labels
c: docs Improvements or additions to documentation p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision

Comments

@ST-DDT
Copy link
Member

ST-DDT commented Apr 7, 2022

Clear and concise description of the problem

Currently LiteralUnions are displayed as their full generic type. This is unessesarily bulky.

grafik

Suggested solution

Since we usually only expect the specified values from that type, we might as well just display them.

LiteralUnion<"abbr" | "date" | "unix" | "wide", string> -> "abbr" | "date" | "unix" | "wide"

Alternative

Change the representation to either:

  • "abbr" | "date" | "unix" | "wide" | string
  • LiteralUnion<"abbr" | "date" | "unix" | "wide">

Additional context

Found while writing issue #794.

@ST-DDT ST-DDT added c: docs Improvements or additions to documentation p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision labels Apr 7, 2022
@ST-DDT ST-DDT added this to the v6 - Non-Breaking Changes milestone Apr 7, 2022
@ST-DDT ST-DDT moved this to Todo in Faker Roadmap Apr 7, 2022
@Shinigami92
Copy link
Member

I would suggest going with "abbr" | "date" | "unix" | "wide" | string

Repository owner moved this from Todo to Done in Faker Roadmap Apr 8, 2022
@ST-DDT ST-DDT removed this from Faker Roadmap Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: docs Improvements or additions to documentation p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants