danielgtaylor / huma

Huma REST/HTTP API Framework for Golang with OpenAPI 3.1
https://huma.rocks/
MIT License
1.87k stars 138 forks source link

Removing schema reference in response #428

Open aleksicmarija opened 4 months ago

aleksicmarija commented 4 months ago

Is it possible to configure removing this from response? "$schema":"http://localhost:8000/api/v1/schemas/SomeSchema.json"

danielgtaylor commented 4 months ago

@aleksicmarija yes, you can stop using the SchemaLinkTransformer that is present in the default config. See here:

https://github.com/danielgtaylor/huma/blob/main/defaults.go#L53

You can either define your own config yourself, or use the default but reset the create hooks to prevent the link transformer from running.

aleksicmarija commented 4 months ago

@aleksicmarija yes, you can stop using the SchemaLinkTransformer that is present in the default config. See here:

https://github.com/danielgtaylor/huma/blob/main/defaults.go#L53

You can either define your own config yourself, or use the default but reset the create hooks to prevent the link transformer from running.

Thanks!