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

items: { nullable: true }としたarrayが正しく変換されない #159

Closed
1 of 3 tasks
ID157 opened this issue Nov 21, 2021 · 4 comments
Closed
1 of 3 tasks

items: { nullable: true }としたarrayが正しく変換されない #159

ID157 opened this issue Nov 21, 2021 · 4 comments

Comments

@ID157
Copy link

ID157 commented Nov 21, 2021

Description

(OSSにコミットをするのに慣れていないため、拙い所が多々あるかもしれませんがご了承いただけますと幸いです)

次のようなnullable:trueなitemsを持つarrayの型が、正しく変換されない。

openapi: 3.0.0
info:
  title: example
  version: '1.0'
servers:
  - url: 'http://localhost:3000'
paths:
  /example:
    get:
      summary: Your GET endpoint
      tags: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Example'
      operationId: get-example
components:
  schemas:
    Example:
      title: Example
      type: array
      description: ''
      items:
        type: number
        nullable: true

上記の定義ファイルをgenerateすると、(number | null)[]となるはずが、次のような型が出力されてしまう。

/* eslint-disable */
export type Example = number | null[]

【参考】
https://github.com/ID157/openapi2aspida-bugreport

  • Package version: v0.16.5
  • OS:
    • Linux
    • Windows
    • macOS
  • Node.js version: v16.7.0
  • npm version: 7.20.3

Additional context

@ghost
Copy link

ghost commented Jan 12, 2022

対応が遅れてしまって申し訳ありません。
最新バージョンでの再現確認しましたので、対処いたします。もうしばらくお待ちください

@ghost ghost mentioned this issue Jan 13, 2022
9 tasks
ghost pushed a commit that referenced this issue Jan 13, 2022
@ghost
Copy link

ghost commented Jan 13, 2022

develpブランチにて対応しました

@ghost ghost closed this as completed in cdca913 Jan 13, 2022
@ID157
Copy link
Author

ID157 commented Jan 14, 2022

対応ありがとうございます🙇‍♂️

@ghost
Copy link

ghost commented Jan 14, 2022

こちら、最新バージョン(v0.17.0)にて対応しています。issue報告ありがとうございました🙇‍♂️

This issue was closed.
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

1 participant