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

メモリ使用量削減のためにポインタを使うと、クライアントは nullable と解釈してしまう #355

Open
chun37 opened this issue Jan 4, 2023 · 0 comments

Comments

@chun37
Copy link
Collaborator

chun37 commented Jan 4, 2023

// GetResponse - レスポンス
type GetResponse struct {
   Payload  []*Hoge  `json:"payload"`  // Payload
   PageInfo *PageInfo `json:"pageInfo"` // ページ情報
}

みたいな定義をした場合、TypeScript のクライアントは

  • payload が nullable になる
  • payload の element が nullable になる
  • pageInfo が nullable になる

ということが発生する。

null ガードを書きまくる必要性があり、非常に面倒である。

null を許容しない と メモリ使用量削減 を両立したい

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