create-frourio-app icon indicating copy to clipboard operation
create-frourio-app copied to clipboard

fix: mod fastify querystring parser

Open casheeeewnuts opened this issue 2 years ago • 2 comments

Types of changes

  • [x] Bug fixes
    • resolves #354
  • [ ] Features
    • resolves #
  • [ ] Maintenance
  • [ ] Documentation

Changes

  • add library 'qs' and '@types/qs' in server/pretense/package.json
  • configure fastify instance with querystringParser: qs.parse in entry point modules

Additional context

Community note

Please upvote with reacting as :+1: to express your agreement.

casheeeewnuts avatar Apr 14 '22 16:04 casheeeewnuts

なるほど、qsを使用しておかないとaspidaが送るものとの整合性が取れないのか。 @aspida/axios はおそらくそうなのだろうが @aspida/fetch がどうなのかは確認が必要だな。その他の@aspida/*で違う挙動を取る場合は、それはそれで別にやらなければいけないが、axiosのときに難なく動く状態のこのPRをマージするのはひとまず良さそう。

LumaKernel avatar Apr 18 '22 09:04 LumaKernel

https://github.com/aspida/aspida/pull/748 上記と似ていますね。

以下、メンバーと話して更に検討したうえでの現在の考えです。

@aspida/axios と frourio-express が本来その責任範囲外であるような [] 付加・取り外しをする、axios/expressデフォルト動作を抑えていないのが修正されるべきで、querystring同等の動作をさせたい場合は個別のプロジェクトで対処するのが良いではないかというふうに考えています。

query: {id: string[]}id[]=... が勝手に飛んでいた @aspida/axios を修正して、もしほしいなら、 query: { 'id[]' : string[]} と書かなければいけないようにするほうが良いと思っています。

LumaKernel avatar Apr 18 '22 10:04 LumaKernel