Marwes / schemafy

Crate for generating rust types from a json schema
MIT License
242 stars 51 forks source link

Support generation from string literals #58

Open itegulov opened 2 years ago

itegulov commented 2 years ago

It would be nice to have an option of passing a string literal to Generator instead of a file path. Think of a case when user's JSON Schema is a part of a bigger JSON file or is a file inside of an archive. I have already implemented this functionality in our fork (see https://github.com/near/schemafy/pull/1/files#diff-bea88ef3ad765bc1058b75944aab0ac87eb4cd96906670cf16bc2bb45a0eb537, ignore other changes in that PR), but happy to prepare this as an upstream PR if you are open to adding this.