Lab: ploymorphic pattern. validation

trying to make this work for two solid days.

please would someone explain what these lines mean as they seem to contradict each other time is again running out for assignments.

Processing document: 1

… against solution: 1

… against solution: 2

… against solution: 3
The document fails validation.

Processing document: 2

… against solution: 1

… against solution: 2

… against solution: 3
The document fails validation.

Processing document: 3

… against solution: 1

… against solution: 2

… against solution: 3
The document passes validation

Errors:
At least one of your solutions is not passing validation.

Hi @getemerson,

Please share the code implementation.

Kanika

Getemerson,

The validator is trying to evaluate 3 answers against 3 solutions.
With the correct answers, document1 would have validated correctly against one of the 3 solutions, the same for document2 and document3.

It seems like the proposed answers are not matching any of the solutions.

Good solutions should not be posted on the forum, however, since these are failing, would you share the first of the 3 documents in your solution as suggested by Kanika?

Thanks,
Daniel

1st document. as you can see the fields the validator reports as missing are in fact present.

{
“_id”: “”,
“first_name”: “”,
“last_name”: “”,
“engineer_level”: “”,
“education”: [{
“level”: “”,
“subject”: “”
}],
“years_experience”: “”,
“previous_employer”: “”,
“technical”: [""],
“non-technical”: {
“languages”: [""],
“other”: [""]
},
“candidate_notes”: “”
}

validator output for document 1:

Processing document: 3

… against solution: 1
Detailed errors :

  • (root): first_name is required
    Detailed errors :
  • (root): last_name is required
    Detailed errors :
  • (root): engineer_level is required
    Detailed errors :
  • (root): years_experience is required
    Detailed errors :
  • (root): previous_employer is required
    Detailed errors :
  • (root): recruiting_source is required
    Detailed errors :
  • (root): technical is required
    Detailed errors :
  • (root): non-technical is required
    Detailed errors :
  • (root): candidate_notes is required
    Detailed errors :
  • (root): Additional property skills is not allowed
    Detailed errors :
  • (root): Additional property program_affiliation is not allowed
    Detailed errors :
  • (root): Additional property end_date is not allowed
    Detailed errors :
  • (root): Additional property name is not allowed
    Detailed errors :
  • (root): Additional property notes is not allowed
    Detailed errors :
  • (root): Additional property start_date is not allowed
    Detailed errors :
  • (root): Additional property team_placement is not allowed

Question:
would it be easier for me to validate one document at a time? the output from the validator i still dont understand im afraid.

can you clarify for example what does this mean:
i have 3 embeded documents in one file according to the lab.

processing document 1
… against solution 1

which of the three documents in my file does this refer to? and what does against solution 1 mean specifically?

i have progressed this far by adding removing each field and looking at the errors reported:
result:
Processing document: 1

… against solution: 1
The document passes validation

Processing document: 2

… against solution: 1
The document passes validation

Processing document: 3

… against solution: 1
The document passes validation

Errors:
At least one of your solutions is not passing validation.

now more confused. any ideas?

1 Like

same situation!

Hi @giuseppe_98802,

Please take a look at this post:

Let me know if this doesn’t help. Also share the error and code implementation to help better.

Kanika

hi
my error output is the same of getemerson.

what I don’t understand is: if my 3 docs passes validation of solution1, 2 and 3
why I get “At least one of your solutions is not passing validation”

thanks
g

@giuseppe_98802 best to ask your question in one thread instead of multiple threads.

you are right. sorry.