schema

package
v0.0.0-...-7a8a256 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package schema implements JSON schema serialization and code generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSchema

type JSONSchema struct {
	Title       string                        `json:"title"`
	Type        string                        `json:"type"`
	Properties  map[string]JSONSchemaProperty `json:"properties"`
	Required    []string                      `json:"required"`
	Definitions map[string]JSONSchema         `json:"definitions"`
}

type JSONSchemaProperty

type JSONSchemaProperty struct {
	Type    string              `json:"type"`
	Format  string              `json:"format,omitempty"`
	Default string              `json:"default,omitempty"`
	Ref     string              `json:"$ref,omitempty"`
	Items   *JSONSchemaProperty `json:"items"`
}

type JSONSchemaToSwiftCodeGenerator

type JSONSchemaToSwiftCodeGenerator struct {
	Schema JSONSchema
}

func (*JSONSchemaToSwiftCodeGenerator) Generate

func (g *JSONSchemaToSwiftCodeGenerator) Generate() (string, error)

Generate recursively processes referenced schemas.

Jump to

Keyboard shortcuts

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