danielgtaylor / danielgtaylor/huma

tag readOnly:"true" does not seem to work on object types

Open
#455 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
4.4k
Forks
285
Avg merge
40m
Merged PRs (30d)
1

Description

I have defined 2 structs, named Notice, and User. The Notice struct has a field of type User with `json:"user" readOnly:"true"` but it ends up in the Body for a post request anyway. Primitive fields, like string and int and such, with `readOnly:"true"` seem to exhibit the expected behaviour.

![image](https://github.com/danielgtaylor/huma/assets/82111415/93d53404-0f63-4cd4-91cb-1fd41fae6f9e)

![image](https://github.com/danielgtaylor/huma/assets/82111415/36a23e3c-cd9f-49a6-8fda-6bbd07886c3f)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.