Example produces an example for the user type which is JSON serialization compatible.
(r *ExampleGenerator)
| 83 | // Example produces an example for the user type which is JSON serialization |
| 84 | // compatible. |
| 85 | func (u *UserTypeExpr) Example(r *ExampleGenerator) any { |
| 86 | if ex := u.recExample(r); ex != nil { |
| 87 | return *ex |
| 88 | } |
| 89 | return nil |
| 90 | } |
| 91 | |
| 92 | func (u *UserTypeExpr) recExample(r *ExampleGenerator) *any { |
| 93 | if ex, ok := r.PreviouslySeen(u.ID()); ok { |