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

[Hook form lib] FormSchema does not narrow the index signature #60602

Closed
sebelga opened this issue Mar 19, 2020 · 1 comment · Fixed by #78588
Closed

[Hook form lib] FormSchema does not narrow the index signature #60602

sebelga opened this issue Mar 19, 2020 · 1 comment · Fixed by #78588
Labels
Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@sebelga
Copy link
Contributor

sebelga commented Mar 19, 2020

As reported by @rylnd in #60567, the FormSchema interface does not narrow the index signature.

The changes he proposes are

-export interface FormSchema<T extends FormData = FormData> {
-  [key: string]: FormSchemaEntry<T>;
-}
+export type FormSchema<T extends FormData = FormData> = {
+  [K in keyof T]: FormSchemaEntry<T[K]>;
+};
@sebelga sebelga added the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Mar 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

sebelga added a commit to sebelga/kibana that referenced this issue Sep 18, 2020
The typings for the FromSchema was too permissive and did not limit the keys to the form interface provided.
Fixes elastic#60602
sebelga added a commit to sebelga/kibana that referenced this issue Sep 22, 2020
The typings for the FromSchema was too permissive and did not limit the keys to the form interface provided.
Fixes elastic#60602
sebelga added a commit to sebelga/kibana that referenced this issue Sep 24, 2020
The typings for the FromSchema was too permissive and did not limit the keys to the form interface provided.
Fixes elastic#60602
sebelga added a commit to sebelga/kibana that referenced this issue Sep 28, 2020
The typings for the FromSchema was too permissive and did not limit the keys to the form interface provided.
Fixes elastic#60602
sebelga added a commit to sebelga/kibana that referenced this issue Sep 28, 2020
The typings for the FromSchema was too permissive and did not limit the keys to the form interface provided.
Fixes elastic#60602
sebelga added a commit to sebelga/kibana that referenced this issue Sep 28, 2020
The typings for the FromSchema was too permissive and did not limit the keys to the form interface provided.
Fixes elastic#60602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants