schemagen

package
v4.9.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

*

  • Copyright (C) 2015 Red Hat, Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

*

  • Copyright (C) 2015 Red Hat, Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONArrayDescriptor

type JSONArrayDescriptor struct {
	Items JSONPropertyDescriptor `json:"items"`
}

type JSONDescriptor

type JSONDescriptor struct {
	Type          string        `json:"type"`
	Description   string        `json:"description"`
	Default       string        `json:"default,omitempty"`
	Required      bool          `json:"required,omitempty"`
	Minimum       float32       `json:"minimum,omitempty"`
	Maximum       float32       `json:"maximum,omitempty"`
	MinItems      int           `json:"minItems,omitempty"`
	MaxItems      int           `json:"maxItems,omitempty"`
	MinLength     int           `json:"minLength,omitempty"`
	MaxLength     int           `json:"maxLength,omitempty"`
	Pattern       string        `json:"pattern,omitempty"`
	Enum          []interface{} `json:"enum,omitempty"`
	JavaOmitEmpty bool          `json:"javaOmitEmpty,omitempty"`
}

type JSONMapDescriptor

type JSONMapDescriptor struct {
	MapValueType JSONPropertyDescriptor `json:"additionalProperty"`
}

type JSONObjectDescriptor

type JSONObjectDescriptor struct {
	Properties           map[string]JSONPropertyDescriptor `json:"properties,omitempty"`
	AdditionalProperties bool                              `json:"additionalProperties"`
}

type JSONReferenceDescriptor

type JSONReferenceDescriptor struct {
	Reference string `json:"$ref"`
}

type JSONSchema

type JSONSchema struct {
	ID          string                            `json:"id"`
	Schema      string                            `json:"$schema"`
	Description string                            `json:"description,omitempty"`
	Definitions map[string]JSONPropertyDescriptor `json:"definitions"`
	JSONDescriptor
	*JSONObjectDescriptor
	Resources map[string]*JSONObjectDescriptor `json:"resources,omitempty"`
}

func GenerateSchema

func GenerateSchema(t reflect.Type, packages []PackageDescriptor, typeMap map[reflect.Type]reflect.Type, customTypeNames map[string]string) (*JSONSchema, error)

type JavaInterfacesDescriptor

type JavaInterfacesDescriptor struct {
	JavaInterfaces []string `json:"javaInterfaces,omitempty"`
}

type JavaTypeDescriptor

type JavaTypeDescriptor struct {
	JavaType string `json:"javaType"`
}

type PackageDescriptor

type PackageDescriptor struct {
	GoPackage   string
	ApiGroup    string
	JavaPackage string
	Prefix      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL