Skip to content

Run openapiTS two times in row throws an Error #707

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

Closed
mbelsky opened this issue Aug 2, 2021 · 0 comments · Fixed by #708
Closed

Run openapiTS two times in row throws an Error #707

mbelsky opened this issue Aug 2, 2021 · 0 comments · Fixed by #708

Comments

@mbelsky
Copy link
Contributor

mbelsky commented Aug 2, 2021

Hey,

I've found an interesting issue with openapiTS: adding one more call of this function in tests/remote-schema/remote-schema.test.ts makes it fails. You may try to run this and you with get the following error:

import path from "path";
import openapiTS from "../../src/index";

describe("remote $refs", () => {
  it("resolves remote $refs", async () => {
    // vvv Add this line vvv
    await openapiTS(path.join(__dirname, "spec", "spec.yml"));
    const types = await openapiTS(path.join(__dirname, "spec", "spec.yml"));
    expect(types).toEqual(`/**
 * This file was auto-generated by openapi-typescript.
 * Do not make direct changes to the file.
 */
 (content not changed)

The Error message: 🚏 version missing from schema; specify whether this is OpenAPI v3 or v2 https://swagger.io/specification

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

Successfully merging a pull request may close this issue.

1 participant