Skip to content
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

Add Array type #2

Closed
acidiney opened this issue Oct 21, 2021 · 1 comment · Fixed by #18
Closed

Add Array type #2

acidiney opened this issue Oct 21, 2021 · 1 comment · Fixed by #18
Assignees
Labels

Comments

@acidiney
Copy link
Owner

acidiney commented Oct 21, 2021

This feat. allow us to create an Dto that receives an Array of items.
When Dto is created, is required to define what is the type of items.

Eg.

  • Using Array of objects:
const objectSchemaDtoEg = MakeDto([
  {
    name: 'testArrayObjSchema',
    type: 'Array',
    itemsType: 'Object',
    objSchema: [
      {
        name: 'Name',
        type: 'String',
        required: true,
        serialize: 'name'
      },
      {
        name: 'Age',
        type: 'Number',
        required: false,
        serialize: 'age'
      }
    ],
    required: true,
    serialize: 'test_array_obj_schema'
  }
])
  • Using Array of numbers:
const objectSchemaDtoEg = MakeDto([
  {
    name: 'testArrayNumbersSchema',
    type: 'Array',
    itemsType: 'Number',
    required: true,
    serialize: 'test_array_numbers_schema'
  }
])

You can use this example to understood the propose of this issue

@acidiney acidiney added help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest labels Oct 21, 2021
@acidiney acidiney self-assigned this Oct 24, 2021
@acidiney
Copy link
Owner Author

I will do this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant