picklemik
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
I am using arktype to parse data from incoming web requests. I define the schema and the parsed result will be passed into my handler. It looks like this and is working perfectly fine right now:
What I want to do now is change
id
in the params
schema to not be a string, but instead define my own "objectId" value. It would parse the string into a mongo ObjectId object, so I don't have to do that in the handler. I believe scopes
are what I am looking for, so I tried doing that, but it breaks my type system and I don't understand why.
I recreated the issue I have in this playground: https://tinyurl.com/arktype18 replies