Is your feature request related to a problem? Please describe.
Being able to use an existing JSON schema is certainly useful, however it does not appear that it is possible further modify the schema using the builder pattern. Both approaches are really useful independently, but would be so much more beneficial to a host of use cases which I have if it were possible to combine them.
Describe the solution you'd like
I would like to be able to write something along the lines of:
Describe alternatives you've considered
Composing derived JSON schemas on using pure JSON and then setting the ObjectBuilder schema to this new JSON schema. It arguably has greater utility since it is library/framework agnostic, but it somewhat undermines the point of using a library such as ajv-ts to create a better, more guided developer experience through [strongly-typed] Typescript.
Additional context
I am using fragments of JSON schema derived from Open API specifications and re-hashing them for use in HTML forms which are validated using AJV.
Is your feature request related to a problem? Please describe. Being able to use an existing JSON schema is certainly useful, however it does not appear that it is possible further modify the schema using the builder pattern. Both approaches are really useful independently, but would be so much more beneficial to a host of use cases which I have if it were possible to combine them.
Describe the solution you'd like I would like to be able to write something along the lines of:
const composedSchema = s.jsonSchema(PERSON_JSON_SCHEMA) .omit({ middleNames: true }) .extend({ nameOfFavouriteShop: s.string(), addressOfFavouriteShop: s.jsonSchema(ADDRESS_JSON_SCHEMA), }) .requiredFor('nameOfFavouriteShop');
Describe alternatives you've considered Composing derived JSON schemas on using pure JSON and then setting the ObjectBuilder schema to this new JSON schema. It arguably has greater utility since it is library/framework agnostic, but it somewhat undermines the point of using a library such as ajv-ts to create a better, more guided developer experience through [strongly-typed] Typescript.
Additional context I am using fragments of JSON schema derived from Open API specifications and re-hashing them for use in HTML forms which are validated using AJV.