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

Bug: DevelopmentError #89

Closed
hi-se opened this issue Nov 2, 2022 · 3 comments
Closed

Bug: DevelopmentError #89

hi-se opened this issue Nov 2, 2022 · 3 comments

Comments

@hi-se
Copy link

hi-se commented Nov 2, 2022

Steps To Reproduce

  1. copy this api definition and paste it in specs/test.yaml
  2. copy sample generator code and paste it in src/generator.ts
  3. replace path in src/generator.ts
  4. execute ts-node src/generator.ts

The current behavior

This error occured.

DevelopmentError: This is an implementation error. Please report any reproducible information below.
https://github.com/Himenon/openapi-typescript-code-generator/issues/new/choose

    at resolveLocalReference (/workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:95:15)
    at /workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:111:18
    at Array.forEach (<anonymous>)
    at resolveLocalReference (/workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:110:25)
    at /workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:111:18
    at Array.forEach (<anonymous>)
    at resolveLocalReference (/workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:110:25)
    at /workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:111:18
    at Array.forEach (<anonymous>)
    at resolveLocalReference (/workspace/node_modules/@himenon/src/internal/ResolveReference/index.ts:110:25)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


Same issue occurred for this api definition.

The expected behavior

@hi-se hi-se added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Nov 2, 2022
@Himenon
Copy link
Owner

Himenon commented Nov 4, 2022

I'll check it

@Himenon Himenon removed the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Nov 4, 2022
@Himenon
Copy link
Owner

Himenon commented Nov 4, 2022

Currently, the following alias pattern do not appear to be implemented We will check to see if they can be supported.

"$ref: #/paths/~1token/post/responses/200"

And, I have confirmed that it works by creating an alias for the components/responses field as follows.

posts:
  /token:
    get:
      # ....
      responses:
        "200":
          $ref: "#/components/responses/Success200"

components:
  responses:
    Success200:
      description: 正常時
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/accessTokenModel"

LIke this: https://github.com/Himenon/openapi-typescript-code-generator/blob/main/test/api.test.domain/index.yml#L306-L311

@hi-se
Copy link
Author

hi-se commented Nov 12, 2022

Thank you for your reply!

I followed your example and was able to resolve the error.

Thanks!

@Himenon Himenon closed this as completed Nov 14, 2022
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

2 participants