Comments (4)
How are you running that fragment to cause the error?
Could you provide the full path of the module which is throwing? Its not part of the generator, nor of ajv
, the module validateSchema uses. So I have no idea which dependency is throwing.
from generator-feathers-plus.
Thanks for the reply, here are the steps to reproduce
Generate App
feathers-plus generate app
? Project name fpcli
? Description Project fpcli
? What folder should the source files live in? src
? Which package manager are you using
(has to be installed globally)? Yarn
? What type of API are you making?
REST, Realtime via Socket.io
? Data mutating tests and seeding may run when NODE_ENV is one of (optional) test
? Seed data records on startup when command line includes --seed? Yes
Generate Service
feathers-plus generate service
? What is the name of the service? posts
? What would you call one row in the posts database? post
? What kind of service is it? Mongoose
? Place service code in which nested folder, e.g. `v1/blog`? (optional)
? Which path should the service be registered on? /posts
? Should this be served by GraphQL? Yes
Add Object with properties to schema:
/src/services/posts/posts.schema.js
properties: {
// !code: schema_properties
address: {
type: 'object',
additionalProperties: { type: 'string' },
maxProperties: 6,
required: ['street', 'postcode', 'city', 'country']
},
// !end
}
Rerun service generate:
feathers-plus generate service
? What is the name of the service? posts
? What would you call one row in the posts database? post
? What kind of service is it? Mongoose
? Place service code in which nested folder, e.g. `v1/blog`? (optional)
? Which path should the service be registered on? /posts
? Should this be served by GraphQL? Yes
events.js:183
throw er; // Unhandled 'error' event
^
TypeError: subTypes.map is not a function
at Object.keys.forEach.name (/Users/me/.config/yarn/global/node_modules/@feathers-plus/generator-feathers-plus/lib/service-specs-to-typescript.js:24:32)
at Array.forEach (<anonymous>)
at serviceSpecsToTypescript (/Users/me/.config/yarn/global/node_modules/@feathers-plus/generator-feathers-plus/lib/service-specs-to-typescript.js:16:27)
at service (/Users/me/.config/yarn/global/node_modules/@feathers-plus/generator-feathers-plus/generators/writing/index.js:583:7)
at generatorWriting (/Users/me/.config/yarn/global/node_modules/@feathers-plus/generator-feathers-plus/generators/writing/index.js:253:7)
at ServiceGenerator.writing (/Users/me/.config/yarn/global/node_modules/@feathers-plus/generator-feathers-plus/generators/service/index.js:246:5)
at Object.<anonymous> (/Users/me/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:424:27)
at /Users/me/.config/yarn/global/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /Users/me/.config/yarn/global/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/Users/me/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:425:13)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
from generator-feathers-plus.
I misunderstood you when you mentioned "json-schema validations". I understood that as you trying to validate record contents using some of the exports from src/services/name/name.validate.?s.
The name.schema.?s expects type: 'object'
to contain a poperties
property which contains at least one field.
So, from the example, instead of
"address": {
"type": "object",
"additionalProperties": { "type": "string" },
"maxProperties": 6,
"required": ["street", "postcode", "city", "country"]
},
rather like the following
"personal": {
"type": "object",
"properties": {
"DOB": { "type": "string", "format": "date" },
"age": { "type": "integer", "minimum": 13 },
"gender": { "enum": ["female", "male"] }
}
"required": ["DOB", "age"],
"additionalProperties": false
},
``
from generator-feathers-plus.
I added an issue to support the notation used in address
#64
from generator-feathers-plus.
Related Issues (20)
- Show how to add custom methods?
- Add support for graphql mutations HOT 1
- Generator adds extra type to JSON schema property when using oneOf keyword
- Re-enabling travis with tests for pull requests
- Can't import external schema and spread it into the local schema HOT 2
- How do you define associations in the json schema file? HOT 2
- With no semicolon option generator adds semicolons
- TypeScript: Extract Application interface for reuse HOT 1
- Simple app doesnt run
- Default value not applied when using with $ref
- graphQL populates don't support dot notation
- TypeError: input.split is not a function HOT 3
- Can't compile Typescript HOT 11
- Semicolons when: "semicolons": false, in feathers-gen-specs.json
- Custom code ignored in regenerating app HOT 1
- Upgrade to FeathersJS v4 (Crow)? HOT 5
- Compound key in uniqueItemProperties?
- How to use faker.js arrayElement HOT 2
- TypeError: graphql.getIntrospectionQuery is not a function
- Pass context.data while testing services HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-feathers-plus.