danielgtaylor / danielgtaylor/huma

documenting array[T] instead of array[object]

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

Description

```go
type userArrayResponse struct {
Body struct {
Users []sql.User `json:"users"`
}
}
```

In the generated OpenAPI docs, `UserArrayResponseBody` schema shows an `array[object]` text which I would like it to say `array[User]`. Documented JSON is correct for User. I've looked for some time but was not able to get this, like trying to implement SchemeProvider etc.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the generated OpenAPI documentation with the provided Go userArrayResponse example, then trace the schema-generation path around SchemeProvider. Check how the []sql.User field is named in the displayed schema while preserving its already-correct JSON representation. Done means the schema text shows array[User] instead of array[object].

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
api, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.