Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x-miro is added in the resolved spec even after explicitly setting preserveMiro: false #268

Closed
Shwetap05 opened this issue Jan 24, 2019 · 8 comments

Comments

@Shwetap05
Copy link

Shwetap05 commented Jan 24, 2019

Using latest npm package of speccy and even after setting preserveMiro: false in options, seeing it added in resolved spec, when loading this spec in swagger editor its complaining about it.

@pderaaij
Copy link
Contributor

In what file do you set the options?

@Shwetap05
Copy link
Author

Shwetap05 commented Jan 28, 2019

Calling speccy from typescript code like below and passing the option there.

private static options = {
        resolve: true,   // Resolve external references
        jsonSchema: true, // Treat $ref like JSON Schema and convert to OpenAPI Schema Objects
        preserveMiro: false // Flag to resolver as to whether to preserve old value of $ref in x-miro
      };

    static async ResolveReferences(documentUrl: string)
    {
        return new Promise<string>(async (resolve,reject) => {
            loader.loadSpec(documentUrl,SpeccyClient.options,(err,data ) => {
                if (err) {reject(err);}
                else {resolve(JSON.stringify(data));}
            })
        })
    }

@NathanAtKadaster
Copy link

I'm having this issue using the docker image as well. I don't think the x-miro extensions should be in a resolved spec at all. Default behaviour should be preserveMiro: false. I thought this was fixed as per #187 and #198, but it looks like this behaviour is still there in 0.9.0.

I was using Docker image wework/speccy:0.9.0 and still get invalid specs after resolving.

@dlouzan
Copy link
Contributor

dlouzan commented Feb 18, 2019

I'm also experiencing this, plus the generated code goes against one of the lint rules:
https://speccy.io/rules/1-rulesets#reference-no-other-properties

@MikeRalphson
Copy link
Contributor

Anyone with a nice short input definition as a repro case?

@dlouzan
Copy link
Contributor

dlouzan commented Feb 18, 2019

I have just added a new issue in oas-kit for this

@timonbimon
Copy link

also having the same issue :(

@djtarazona
Copy link
Contributor

Fixed here Mermade/oas-kit#152 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants