- Use built-in JSON String transformation for JSON String output in
S.compile - Fix #150
- Add
S.brandfor TS API - Update Standard Schema error message to only include reason part
- Fix refinement on union schema which also uses
S.to
- Add
promisetype andS.promise(instead of async flag internally)
const userSchema = S.schema({
id: S.string,
name: S.string
})
S.parseOrThrow(data, userSchema)
- S.parseJsonOrThrow(data, userSchema)
+ S.convertFromOrThrow(data, S.json, userSchema)
- S.parseJsonStringOrThrow(data, userSchema)
+ S.convertFromOrThrow(data, S.jsonString, userSchema)
- S.reverseConvertOrThrow(user, userSchema)
+ S.convertOrThrow(user, S.reverse(userSchema))
- S.reverseConvertToJsonOrThrow(user, userSchema)
+ S.convertFromOrThrow(user, userSchema, S.json)
- S.reverseConvertToJsonStringOrThrow(user, userSchema)
+ S.convertFromOrThrow(user, userSchema, S.jsonString)
- S.reverseConvertToJsonStringOrThrow(user, userSchema, 2)
+ S.convertFromOrThrow(user, userSchema, S.jsonStringWithSpace(2))
S.convertOrThrow(data, userSchema)
- S.convertToJsonOrThrow(data, userSchema)
+ S.convertOrThrow(data, userSchema.with(S.to, S.json))
- S.convertToJsonStringOrThrow(data, userSchema)
+ S.convertOrThrow(data, userSchema.with(S.to, S.jsonString))-
rename
serializerto reverse parser ? -
Make
foo->S.to(S.unknown)stricter ?? -
Add
S.to(from, target, parser, serializer)instead ofS.transform? -
Remove
s.failwiththrow new Error -
Make built-in refinements not work with
unknown. UseS.to(manually & automatically) to deside the type first -
Better inline empty recursive schema operations (union convert)
-
Don't iterate over JSON value when it's
S.jsonconvert without parsing -
Add
S.date.with(S.migrationFrom, S.string, <optionalParser>). -
Allow to pass {} instead of S.schema({}) to S.array and other schemas
- Add
S.envto support coercion for union items separately. Likerescript-envsafeused to do withpreprocess - Make
S.recordaccept two args - Update docs
- Add
s.parseChildto EffectContext ??? - Start using rescript v12 (Fix unboxed types in JSONSchema module)
- Support arrays for
S.to - Remove fieldOr in favor of optionOr?
- Allow to pass custom error message via
.with - Make S.to extensible
- Add S.Date (S.instanceof) and remove S.datetime
- Add refinement info to the tagged type
- Remove
S.deepStrictandS.deepStripin favor ofS.deep(if it works) - Make S.serializeToJsonString super fast
- Somehow determine whether transformed or not (including shape)
- Add JSDoc
- s.optional for object
- S.transform(s => { s.reverse(input => input) // Or s.asyncReverse(input => Promise.resolve(input)) input => input }) // or asyncTransform // Maybe format ?
- Clean up Caml_option.some, Js_dict.get
- Github Action: Add linter checking that the generated files are up to date (?)
- Support optional fields (can have problems with serializing) (???)
- S.mutateWith/S.produceWith (aka immer) (???)
- Add S.function (?) (An alternative for external ???)
let trimContract: S.contract<string => string> = S.contract(s => {
s.fn(s.arg(0, S.string))
}, ~return=S.string)
- Use internal transform for trim
- Add schema input to the error ??? What about build errors?
- async serializing support
- Add S.promise
- S.create / S.validate
- Add S.codegen
- Rename S.inline to S.toRescriptCode + Codegen type + Codegen schema using type
- Make
error.reasontree-shakeable - S.toJSON/S.castToJson ???
- S.produce
- S.mutator
- Check only number of fields for strict object schema when fields are not optional (bad idea since it's not possible to create a good error message, so we still need to have the loop)