From 9599e63ffb6935d20b40f0ea992c1d2a84c86855 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Fri, 20 Jan 2023 16:24:39 +0100 Subject: [PATCH] changed comment type --- bundle/schema/schema.go | 44 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/bundle/schema/schema.go b/bundle/schema/schema.go index a76658aec..240ba87c4 100644 --- a/bundle/schema/schema.go +++ b/bundle/schema/schema.go @@ -37,29 +37,27 @@ type Schema struct { Required []string `json:"required,omitempty"` } -/* -This function translates golang types into json schema. Here is the mapping -between json schema types and golang types - - - GolangType -> Javascript type / Json Schema2 - - - bool -> boolean - - - string -> string - - - int (all variants) -> number - - - float (all variants) -> number - - - map[string]MyStruct -> { type: object, additionalProperties: {}} - for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties - - - []MyStruct -> {type: array, items: {}} - for details visit: https://json-schema.org/understanding-json-schema/reference/array.html#items - - - []MyStruct -> {type: object, properties: {}, additionalProperties: false} - for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#properties -*/ +// This function translates golang types into json schema. Here is the mapping +// between json schema types and golang types +// +// - GolangType -> Javascript type / Json Schema2 +// +// - bool -> boolean +// +// - string -> string +// +// - int (all variants) -> number +// +// - float (all variants) -> number +// +// - map[string]MyStruct -> { type: object, additionalProperties: {}} +// for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties +// +// - []MyStruct -> {type: array, items: {}} +// for details visit: https://json-schema.org/understanding-json-schema/reference/array.html#items +// +// - []MyStruct -> {type: object, properties: {}, additionalProperties: false} +// for details visit: https://json-schema.org/understanding-json-schema/reference/object.html#properties func NewSchema(golangType reflect.Type, docs *Docs) (*Schema, error) { tracker := newTracker() schema, err := safeToSchema(golangType, docs, "", tracker)