parser

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package parser reads specifications and converts them into the `genclient.API` model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateModel

func CreateModel(cfg *ModelConfig) (*api.API, error)

CreateModel parses the service specification referenced in `config`, cross-references the model, and applies any transformations or overrides required by the configuration.

func ParseDisco

func ParseDisco(cfg *ModelConfig) (*api.API, error)

ParseDisco reads discovery docs specifications and converts them into the `api.API` model.

func ParseOpenAPI

func ParseOpenAPI(cfg *ModelConfig) (*api.API, error)

ParseOpenAPI parses an OpenAPI specification and returns an API model.

func ParseProtobuf

func ParseProtobuf(cfg *ModelConfig) (*api.API, error)

ParseProtobuf reads Protobuf specifications and converts them into the `api.API` model.

Types

type ModelConfig added in v0.8.1

type ModelConfig struct {
	Language string

	// Source configuration
	// SpecificationFormat is the format of the API specification.
	// Supported values are:
	// - `config.SpecDiscovery`: "discovery"
	// - `config.SpecOpenAPI`: "openapi"
	// - `config.SpecProtobuf`: "protobuf"
	// - `config.SpecNone`: "none"
	SpecificationFormat string
	SpecificationSource string
	Source              map[string]string

	// Service config
	ServiceConfig string

	// Codec configuration
	Codec map[string]string

	// Documentation/pagination overrides
	CommentOverrides    []config.DocumentationOverride
	PaginationOverrides []config.PaginationOverride

	// Discovery poller configurations
	Discovery *config.Discovery

	// Model overrides
	Override api.ModelOverride
}

ModelConfig holds the configuration necessary to parse an API specification.

Directories

Path Synopsis
Package discovery parses Google Discovery Documents into the sidekick abstract API model (`api.API`).
Package discovery parses Google Discovery Documents into the sidekick abstract API model (`api.API`).
Package httprule provides a parser for the path templates found in [google.api.http] annotations.
Package httprule provides a parser for the path templates found in [google.api.http] annotations.
Package svcconfig contains helper functions to parse service config files.
Package svcconfig contains helper functions to parse service config files.

Jump to

Keyboard shortcuts

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