Closed johnoneil closed 3 years ago
Okay I had to look it up, but the way to examine the contents of the procedural macro code is like:
# first install cargo-expand
# Then you can get expanded code for whatever your target is. Here a test.
cargo expand --test test_name
Appreciate your work on this crate.
You can also run cargo doc --no-deps
and look at the generated documentation.
This crate seems very clever and useful, but I'm having difficulty using it in a practical way.
I've consulted the doctest examples and they elide over many particulars, mostly about how to infer the generated struct names from the schema. Is it possible to examine the generated code?
In the doctest example, the
nested.json
schema, the code simply uses theDefnested
type which is mysterious to me in a number of ways:So, presumably one should infer by trial and error the name of the generated types?
How then can I infer the generated types the schema has no
title
ortype
at the root?I'm sorry to be a bit lost here, but if I'm having some difficulties I'd imagine many people would have the same difficulties.