GREsau / schemars

Generate JSON Schema documents from Rust code
https://graham.cool/schemars/
MIT License
826 stars 229 forks source link

Document macro attributes #322

Closed SorteKanin closed 2 months ago

SorteKanin commented 2 months ago

Via this issue I just discovered that #[schemars(skip)] is a thing. However, where is this documented? I can't find anywhere that the actual attributes of the macro is documented. What other attributes are possible?

GREsau commented 2 months ago

All of the attributes are documented here: https://graham.cool/schemars/deriving/attributes/

SorteKanin commented 2 months ago

I see - I never found this site. The only prominent link seems to be from the GitHub sidebar, which I only notice now that I looked for it. I assumed the docs on docs.rs would be sufficient. I think in general, it's a good idea to have the docs.rs docs be complete for the library. Is there any specific reason you're using another site than docs.rs? It'd be helpful if the docs.rs contained all the relevant documentation.

GREsau commented 2 months ago

Fair point - I've now included the deriving/attributes docs in the derive macro's rustdoc: https://docs.rs/schemars/1.0.0-alpha.9/schemars/derive.JsonSchema.html

And I've linked to that rustdoc from the trait rustdoc: https://docs.rs/schemars/1.0.0-alpha.9/schemars/trait.JsonSchema.html

How does that look?

SorteKanin commented 2 months ago

Excellent, very nice. Thank you.