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

UI inconsistencies within forms #430

Open
Skelmis opened this issue Jan 14, 2025 · 2 comments
Open

UI inconsistencies within forms #430

Skelmis opened this issue Jan 14, 2025 · 2 comments

Comments

@Skelmis
Copy link
Contributor

Skelmis commented Jan 14, 2025

Piggy backing on #134 but further diving into it, the forms UI fails to utilise the data provided via the schema route under some scenarios.

Case one

Code:

class Form(BaseModel):
    end_date: Optional[date] = None

Schema:

{
	"end_date": {
		"anyOf": [
			{
				"format": "date",
				"type": "string"
			},
			{
				"type": "null"
			}
		],
		"default": null,
		"title": "End Date"
	}
}

Expectation:
UI displays the date picker, but with no value selected by default

Actual:
Empty text field

Case two

Code:

class Form(BaseModel):
    enum: MyEnum

Schema:
Includes a $defs to the schema area with the correct data

Expectation:
Drop down with the values

Actual:

  1. It fails to put a name above to the text field
  2. Empty text field

Case three

Clicking "Use again" does not appear to prefill placeholders

@dantownsend
Copy link
Member

Thanks for reporting this - you're right, I can replicate this issue.

Enums are quite tricky, because the OpenAPI schema uses refs, which are kind of a pain. I would like to support these though.

Things like optional date fields not working is definitely a bug.

@dantownsend
Copy link
Member

I've found the cause of the optional date field bug - will put up a PR.

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

No branches or pull requests

2 participants