Skip to content

Commit

Permalink
Updating readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Sep 6, 2023
1 parent b954aa2 commit 0f79090
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ Sometimes it can be useful to have custom JSON Marshal and Unmarshal methods in

To override auto-generating an object type for your type, implement the `JSONSchema() *Schema` method and whatever is defined will be provided in the schema definitions.

You also have the option of defining a `JSONSchemaExtend(schema *jsonschema.Schema)` method for your types that will be called _after_ the schema has been generated, allowing you to add or manipulate the fields easily.

Take the following simplified example of a `CompactDate` that only includes the Year and Month:

```go
Expand Down

0 comments on commit 0f79090

Please sign in to comment.