Skip to content

Support URLs as base paths for schemas #57

@mikhailshilkov

Description

@mikhailshilkov

I'd love to analyze a schema which is stored at GitHub directly

url := "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/network/resource-manager/Microsoft.Network/stable/2020-04-01/publicIpAddress.json"
spec := analysis.New(swagger)
err = analysis.Flatten(analysis.FlattenOpts{Spec: spec, Expand: true, BasePath: url})

Currently, I get

open /mylocalpath/https:/raw.githubusercontent.com/Azure/azure-rest-api-specs/master/
specification/network/resource-manager/Microsoft.Network/stable/2020-04-01/network.json: 
no such file or directory

as it tries to resolve external schema definitions (which are stored on the same GitHub).

Are there fundamental limitations to do this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions