feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
15.03k stars 750 forks source link

Updating from feather 33 pre-release to 34 gives json schema errors for type #2933

Closed prajwal497 closed 1 year ago

prajwal497 commented 1 year ago

Steps to reproduce

Can not create query syntax schema for property 'modes'. Only types string, number, integer, boolean, null are allowed.

modes: { type: 'array', items: { type: 'string' } },

Expected behavior

Module versions (especially the part that's not working):

NodeJS version:

Operating System:

Browser Version:

React Native Version:

Module Loader:

prajwal497 commented 1 year ago

@daffl Hello can you please assist me urgently on this?

daffl commented 1 year ago

The query syntax does not work reliably with arrays. You can add your own properties to the query syntax as a union or intersect type (e.g. see https://dove.feathersjs.com/api/schema/typebox.html#querysyntax) or extend the querySyntax JSON schema with the property you want to allow.

prajwal497 commented 1 year ago

But i am using JSON schema and i need nested schema structure (array and objects) in main data model schema Union type is supported in TypeBox, right?

daffl commented 1 year ago

I'll revert the handling of this in https://github.com/feathersjs/feathers/pull/2941 - the main reason why it threw an error was when using $ref which definitely does not work. However, any and things like that should be avoided as well.