Sequerlize model data type issue #17220
Unanswered
gordonwho
asked this question in
Help & Questions
Replies: 1 comment 1 reply
-
The type you use there is entirely up to you, but I would suggest JsonValue (or one of the other JsonX that better matches the shape) from type-fest |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently using sequelize version 6 for a project I inherited. In the code I see we are importing Json data type from a project :
import { Json } from 'aws-sdk/clients/robomaker';
In the code we have
import { DataTypes, Model, Optional } from 'sequelize';
export interface formQuestionsAttributes {
id?: number;
....
answerValues?: Json;
}
export type formQuestionsOptionalAttributes =
| 'id'
.....
| 'answerValues';
export class formQuestions
extends Model<formQuestionsAttributes, formQuestionsCreationAttributes>
implements formQuestionsAttributes
{
id?: number;
....
answerValues?: Json;
It looks like we are only importing the Json data type from aws-sdk/clients/robomaker and nothing else. We are currently converting aws-sdk version 2 to aws-sdk version 3 and it looks like in aws-sdk/client-robomaker Json type is gone. Can I use the data type 'any' to replace 'Json' ?
answerValues?: any;
would it cause any problems? Please advise, Thanks
Beta Was this translation helpful? Give feedback.
All reactions