simonireilly / compeller

A strong typescript binding for your OpenAPI Schema that doesn't need generation and is not prescriptive in coding style
MIT License
22 stars 1 forks source link

refactor: investigate if double inference is required #41

Open simonireilly opened 2 years ago

simonireilly commented 2 years ago

Currently the type for ajv is inferred, from the type of the object.

This object is inferred from the JSONSchema type. It looks as below:

Ajv.compile<JSONSchemaType<FromSchema<typeof schema>>>(schema)

This double inference might not be necessary, since the schema type is already know.

Investigate if:

Ajv.compile(schema)

Returns the expected type from validation, without supplying a generic