effect icon indicating copy to clipboard operation
effect copied to clipboard

`FormData` and `FormDataFromSelf`

Open KhraksMamtsov opened this issue 1 year ago • 5 comments

Type

  • [ ] Refactor
  • [x] Feature
  • [ ] Bug Fix
  • [ ] Optimization
  • [ ] Documentation Update

Description

I tried to solve this issue https://github.com/Effect-TS/effect/issues/3986

import { Schema } from 'effect'

const fdSchema = S.FormData(S.Struct({
    num: S.NumberFromString
}))

the interesting part was that when encoding, information about an empty array is lost - I solved this using ast-based parsing - I'm not sure if this is the right or complete solution

Related

  • Related Issue # https://github.com/Effect-TS/effect/issues/3986
  • Closes #

KhraksMamtsov avatar Nov 27 '24 13:11 KhraksMamtsov

🦋 Changeset detected

Latest commit: edc9cdf1d9151f17f5afdd4137645d512a2b3840

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 34 packages
Name Type
effect Minor
@effect/cli Major
@effect/cluster-browser Major
@effect/cluster-node Major
@effect/cluster-workflow Major
@effect/cluster Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc-http Major
@effect/rpc Major
@effect/sql-clickhouse Major
@effect/sql-d1 Major
@effect/sql-drizzle Major
@effect/sql-kysely Major
@effect/sql-libsql Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/sql Major
@effect/typeclass Major
@effect/vitest Major
@effect/ai Major
@effect/ai-openai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Nov 27 '24 13:11 changeset-bot[bot]

cc @gcanti specifically for input here

IMax153 avatar Nov 27 '24 13:11 IMax153

@gcanti do you have any thoughts on this? it seems there is a request for this schema from the community, so I thought it would make sense to land it in effect

KhraksMamtsov avatar Dec 09 '24 13:12 KhraksMamtsov

I think a good starting point would be to write a detailed proposal in the linked issue (as suggested by its label). It's unclear to me which use cases are being addressed, which array formats will be supported (dot notation? bracket notation? both? neither?), and why this should be a concern for Schema (I don't dismiss it, but it would be helpful to have evidence for this). For instance, for the sake of discussion, why not simply use something like https://github.com/fabian-hiller/decode-formdata and validate its output instead?

gcanti avatar Dec 16 '24 17:12 gcanti

Leaving it here, because I think it's related https://github.com/inato/inato-form/

nikelborm avatar Jun 07 '25 19:06 nikelborm