type Generator … type TemplateContext … type generator … func NewGenerator() Generator { … } func (g *generator) AddTemplate(name string, contents string) error { … } func (g *generator) Render( // Template to use for rendering templateName string, // Self-Contained OpenAPI Document Containing all schemas used by $ref // Only OpenAPI V3 documents are supported document map[string]interface{ … }