Skip to content

Object has no field "components", but it has (flattening error) #2903

@AlexVirlan

Description

@AlexVirlan

Problem statement

I am using this fantastic project to flatten some big swaggers (because a 3rd party app I use can't use swaggers if they are not flattened sadly). When I try to flatten the swagger, I receive the 'Object has no field "components"' error no matter what --with-flatten option I choose. But clearly, there is a "components" field that contains 3 more fields: schemas, headers and responses. It worked in the past (mainly with 2.0 swaggers), but this is the first time that I am using an openAPI 3.0.0 swagger - hence this issue. Also, I can not modify the swagger in any way since it is provided by another company and I have to use it as is. Ps. I'm new to this go-swagger, please forgive me if I shouldn't have posted here. Thank you all!

Swagger specification

For security reasons, I can't share the swagger but I can share its overall structure:
https://i.imgur.com/eiqoZ1T.png

Steps to reproduce

gs flatten swagger.json --output=out.json --with-flatten=expand

Environment

swagger version: 3.0.0
go version: v0.30.4
OS: Win 10 Pro 21H2

Metadata

Metadata

Assignees

No one assigned

    Labels

    flattenRelated to spec flattening

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions