Search code examples
jsonschemafeathersjs

Where is id: { type: 'ID' } generated in in the featherjs models created by feathers-plus cli defined in the official jsonschema?


I have looked at the json schema docs and examples and do not see a type of ID as created in the json models by the generator. Example feathers-plus cli jsonschema

  properties: {
    // !code: schema_properties
    id: { type: 'ID' },
    email: {},

In the jsonschema official docs example id is defined like

"properties": {
      "id": {
        "type": ["string", "integer"],

Solution

  • This is not allowed by JSON Schema.

    According to the docs at https://github.com/feathers-plus/generator-feathers-plus/tree/master/docs/json-schema

    Feathers Models are based on JSON-schema.

    This reads to me that their models are not quite JSON Schema.

    If you want to know why, you should probably raise an issue on their github repo.