Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
How can i send array of object in postman?

I have this schema and whenever i try to post request using postman, it returns me error as basic is of required type "String" but i have defined it as number. I am also having trouble posting array of objects for bonuses and deductable. It is posting empty array. What is the way to post array of objects in postman?

const LevelSchema = new Schema({
  name: {
    type: String,
    required: true
  },
  description: {
    type: String
  },
  basic: {
    type: Number,
    required: true
  },
  bonuses: [
    {
      name: {
        type: String,
        required: true
      },
      amount: {
        type: Number,
        required: true
      }
    }
  ],
  deductables: [
    {
      name: {
        type: String,
        required: true
      },
      amount: {
        type: Number,
        required: true
      }
    }
  ],
  is_delete: {
    type: Number,
    default: 0
  }
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can create a new schema for bonuses and deductables. Because the share all properties, you can even use the same schema for both. For example:

const BonusesDeductableSchema = new Schema({ 
    name: { type: String, required: true},
    amount: { type: String, required: true},
});

And then, apply this schema in your LevelSchema:

const LevelSchema = new Schema({
    name: {
        type: String,
        required: true
    },
    description: {
        type: String
    },
    basic: {
        type: Number,
        required: true
    },
    bonuses: [BonusesDeductableSchema],
    deductables: [BonusesDeductableSchema],
    is_delete: {
        type: Number,
        default: 0
    }
});

I think this should work.

Then, in your postman, something like this:

{
    "name": "string",
    "description": "string",
    "basic": 1,
    "bonuses": [
        {
            "name": "string",
            "amount": 1
        },
        {
            "name": "string",
            "amount": 1
        }
    ],
    "deductables": [
        {
            "name": "string",
            "amount": 1
        },
        {
            "name": "string",
            "amount": 1
        }
    ],
    "is_delete": 1
}

Hope I helped.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!