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

Add attribute types to docs #16128

Closed
BinaryMoon opened this issue Jun 12, 2019 · 6 comments · Fixed by #16220
Closed

Add attribute types to docs #16128

BinaryMoon opened this issue Jun 12, 2019 · 6 comments · Fixed by #16220
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Developer Documentation Documentation for developers

Comments

@BinaryMoon
Copy link

When registering a block you can define the attributes and their types, but I can't find any docs detailing what the allowed types are.

https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-attributes.md

I can guess what some of them are, but what about boolean? Is it boolean or bool? And number/ int/ float/ all of the above?

I think a proper list would be very helpful.

Thanks

@aduth
Copy link
Member

aduth commented Jun 12, 2019

I agree it should be documented more explicitly. To answer, the types support is meant to align with JSON Schema types, similar to that of the schemas used in registering REST routes server-side.

https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1

@aduth aduth added [Type] Developer Documentation Documentation for developers Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Jun 12, 2019
@BinaryMoon
Copy link
Author

Thanks - that helps.

@AdamDTak2112
Copy link
Contributor

I can work on getting this info stated explicitly on the documentation, if still needed!

@chrisvanpatten
Copy link
Member

@AdamDTak2112 That would be awesome!

@AdamDTak2112
Copy link
Contributor

@chrisvanpatten Perfect. Should I include the Schema page that @aduth posted above listing the various types, or are a brief list enough for the developer to understand?

@chrisvanpatten
Copy link
Member

@AdamDTak2112 I think a brief list would be a good starting point, and also maybe link out to the Schema docs for the WP REST API: https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants