mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
apidocs: add missing format to integers and floats (#4796)
Some checks failed
code_lint / golangci_lint (push) Has been cancelled
code_lint / mod_tidy (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled
Some checks failed
code_lint / golangci_lint (push) Has been cancelled
code_lint / mod_tidy (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_e2e (push) Has been cancelled
This commit is contained in:
parent
98f7a749de
commit
e15795b1be
2 changed files with 48 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ import (
|
|||
type openAPIProperty struct {
|
||||
Ref string `json:"$ref"`
|
||||
Type string `json:"type"`
|
||||
Format string `json:"format"`
|
||||
Nullable bool `json:"nullable"`
|
||||
Items *openAPIProperty `json:"items"`
|
||||
}
|
||||
|
|
@ -157,7 +158,10 @@ func TestAPIDocs(t *testing.T) {
|
|||
content2.Properties[js] = openAPIProperty{Type: "string"}
|
||||
|
||||
case sf.Type == reflect.TypeOf(int(0)):
|
||||
content2.Properties[js] = openAPIProperty{Type: "integer"}
|
||||
content2.Properties[js] = openAPIProperty{Type: "integer", Format: "int64"}
|
||||
|
||||
case sf.Type == reflect.TypeOf(float64(0)):
|
||||
content2.Properties[js] = openAPIProperty{Type: "number", Format: "float64"}
|
||||
|
||||
case sf.Type == reflect.TypeOf(false):
|
||||
content2.Properties[js] = openAPIProperty{Type: "boolean"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue