-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Property internalSlots expected type of array but got boolean #27
Comments
Please can you provide some more detail as how to reproduce this error. |
+1, I avoided it downgrading to 0.2.6 (the previous version I was using) |
@benjamine @natramov can you provide more information. Would be helpful to have the schema that is causing this issue. Closing until that point. |
const jsonSchemaToFlowType = require("json-schema-to-flow-type");
const schema = {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"reportType": {
"type": "string",
"example": "issues",
"description": "a report type"
},
"params": {
"type": "object",
"description": "parameters for the report.\n these can be specific to the report type",
"properties": {}
},
"createdAt": {
"$ref": "#/definitions/Date"
}
},
"additionalProperties": false,
"required": [
"id",
"reportType",
"params",
"createdAt"
],
"id": "Report"
};
const imports = {
"Report": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"reportType": {
"type": "string",
"example": "issues",
"description": "a report type"
},
"params": {
"type": "object",
"description": "parameters for the report.\n these can be specific to the report type"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}:\\d{2}\\.{0,1}[0-9]*Z$",
"description": "creation datetime"
}
},
"additionalProperties": false,
"required": [
"id",
"reportType",
"params",
"createdAt"
],
"id": "Report"
},
"ReportList": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"$ref": "#/definitions/Report"
}
}
},
"additionalProperties": false,
"required": [
"entries"
],
"id": "ReportList"
}
};
jsonSchemaToFlowType.parseSchema(schema, imports); on 0.4.0 throws:
(works fine with 0.2.6) |
@benjamine thanks for this, will investigate |
@wmonk Any updates? |
Looks like the problem is the |
As a stopgap, @marudor has published @marudor/json-schema-to-flow-type with the fix. |
This problem was solved in #28 and v1.0.0 was released. |
Hi, in version 0.4.0 i get this type error:
TypeError: Property internalSlots expected type of array but got boolean at validate (/Users/admin/WebstormProjects/flow-swagger/node_modules/@babel/types/lib/definitions/utils.js:161:13) at Object.validate (/Users/admin/WebstormProjects/flow-swagger/node_modules/@babel/types/lib/definitions/utils.js:172:7) at validate (/Users/admin/WebstormProjects/flow-swagger/node_modules/@babel/types/lib/validators/validate.js:17:9) at builder (/Users/admin/WebstormProjects/flow-swagger/node_modules/@babel/types/lib/builders/builder.js:46:27) at ObjectTypeAnnotation (/Users/admin/WebstormProjects/flow-swagger/node_modules/@babel/types/lib/builders/generated/index.js:649:31) at processObjectSchema (/Users/admin/WebstormProjects/flow-swagger/node_modules/json-schema-to-flow-type/lib/FlowTypeGenerator.js:43:12) at exports.toFlowType.flowSchema (/Users/admin/WebstormProjects/flow-swagger/node_modules/json-schema-to-flow-type/lib/FlowTypeGenerator.js:60:12) at exports.toFlow.flowSchema (/Users/admin/WebstormProjects/flow-swagger/node_modules/json-schema-to-flow-type/lib/index.js:33:194) at exports.schemaToFlow.flowSchema (/Users/admin/WebstormProjects/flow-swagger/node_modules/json-schema-to-flow-type/lib/index.js:35:139) at /Users/admin/WebstormProjects/flow-swagger/node_modules/lodash/lodash.js:5138:35
The text was updated successfully, but these errors were encountered: