Skip to content

Flatten fails when loading a spec from a local file #66

@bytheway

Description

@bytheway

I created a demo in a repo here.

Essentially, when using a local openapi.yaml file:

	doc, err := loads.Spec("./openapi.yaml")
	if err != nil {
		log.Fatal(err)
	}
	an := analysis.New(doc.Spec()) // Analyze spec
	err = analysis.Flatten(analysis.FlattenOpts{
		Spec:   an,
		Expand: true,
	})
	if err != nil {
		log.Fatalf("Flatten Failed: %v", err)
	}

The call to Flatten fails with:

2021/01/26 11:41:38 Flatten Failed: read /Users/bbytheway/tmp/go-openapi-loader-test: is a directory
exit status 1

This functionality worked with

	github.com/go-openapi/loads v0.19.7 // indirect
	github.com/go-openapi/strfmt v0.19.6 // indirect

but is failing with the latest versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions