Documentation
¶
Overview ¶
Package testutil provides test utilities and fixtures for unit tests.
Index ¶
- func NewDetailedOAS2Document() *parser.OAS2Document
- func NewDetailedOAS3Document() *parser.OAS3Document
- func NewSimpleOAS2Document() *parser.OAS2Document
- func NewSimpleOAS3Document() *parser.OAS3Document
- func WriteTempJSON(t *testing.T, doc interface{}) string
- func WriteTempYAML(t *testing.T, doc interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDetailedOAS2Document ¶
func NewDetailedOAS2Document() *parser.OAS2Document
NewDetailedOAS2Document creates a complete OAS 2.0 document with common features for testing. Includes paths, operations, schemas, and definitions.
func NewDetailedOAS3Document ¶
func NewDetailedOAS3Document() *parser.OAS3Document
NewDetailedOAS3Document creates a complete OAS 3.x document with common features for testing. Includes paths, operations, schemas, and components.
func NewSimpleOAS2Document ¶
func NewSimpleOAS2Document() *parser.OAS2Document
NewSimpleOAS2Document creates a minimal OAS 2.0 document for testing. Contains only required fields: swagger, info, host, basePath, schemes, paths.
func NewSimpleOAS3Document ¶
func NewSimpleOAS3Document() *parser.OAS3Document
NewSimpleOAS3Document creates a minimal OAS 3.x document for testing. Contains only required fields: openapi, info, paths, servers.
func WriteTempJSON ¶
WriteTempJSON marshals a document to JSON and writes it to a temporary file. Returns the path to the temporary file. The file is automatically cleaned up when the test completes (via t.TempDir).
func WriteTempYAML ¶
WriteTempYAML marshals a document to YAML and writes it to a temporary file. Returns the path to the temporary file. The file is automatically cleaned up when the test completes (via t.TempDir).
Types ¶
This section is empty.