Commit graph

19 commits

Author SHA1 Message Date
d01c4389be
fix: allow users to set multi-line comments
Main changes:

- Add an option to add multi-line comments at the top of the generated
  file.
- Add an option to name the top-level type.

Additional changes:

- Replace deprecated strings.Title with a custom title function.
- Refactor code based on linter feedback.
- Update LICENSE.
- Update go.mod and upgrade github.com/dave/jennifer from
  v1.5.1 to v1.7.0.
- Update documentation.
2023-11-24 18:31:57 +00:00
Simon Ser
e0d73b5371 Consistently use json.RawMessage 2023-02-24 17:01:53 +01:00
Simon Ser
221c18e60a Special-case nullable schema 2023-02-24 16:53:44 +01:00
Simon Ser
b8a10fdb3a Handle arrays in schema type 2022-10-10 19:17:30 +02:00
Simon Ser
253c170dbe Generate helpers for then, else and dependantSchemas 2022-10-07 12:10:12 +02:00
Simon Ser
3fd30c72bc Use json.Number for numbers
To avoid precision loss.
2022-10-07 11:51:37 +02:00
Simon Ser
3252e0dde7 Switch to CLI flags 2022-10-07 11:49:41 +02:00
Simon Ser
a00e3ecea0 Generate helpers to decode allOf/anyOf/oneOf 2022-10-07 11:32:51 +02:00
Simon Ser
49d4519492 Use json.RawMessage instead of interface{}
This allows the user to perform custom logic to decide how to
decode the JSON.
2022-10-07 11:29:04 +02:00
Simon Ser
7ffb8e8292 Sort struct fields by name 2022-10-07 09:21:00 +02:00
Simon Ser
9d15ffaa5c Sort definitions by name 2022-10-07 09:19:34 +02:00
Simon Ser
1a70f56123 Don't generate type for root if it's a ref 2022-10-07 09:16:38 +02:00
Simon Ser
c7b65e3ab4 Improve formatId() robustness 2022-10-07 09:15:43 +02:00
Simon Ser
4677a978a1 Add pointer if struct is optional 2022-10-06 19:39:34 +02:00
Simon Ser
e1d654c3ba Add "omitempty" to json struct tag if optional 2022-10-06 19:15:48 +02:00
Simon Ser
a640ba04bc Generate types for all $defs 2022-10-06 19:09:57 +02:00
Simon Ser
0b18cdd7be Handle patternProperties with a single element 2022-10-06 19:05:51 +02:00
Simon Ser
5e9f28cc05 Handle non-extensible nested objects 2022-10-06 16:13:46 +02:00
Simon Ser
dde5b75d7a Initial commit 2022-10-06 09:26:45 +02:00