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

Error message is not showing exact element containing error #369

Closed
nggoenka opened this issue Jan 19, 2021 · 10 comments
Closed

Error message is not showing exact element containing error #369

nggoenka opened this issue Jan 19, 2021 · 10 comments

Comments

@nggoenka
Copy link

Every invalid json element shows same error:
$: should be valid to one and only one of the schemas.

@stevehu
Copy link
Contributor

stevehu commented Jan 19, 2021

Could you please create a PR with your test case to reproduce your issue?

@nggoenka
Copy link
Author

Please have a check nggoenka/FhirValidationExample#1

@nggoenka
Copy link
Author

ValidatorExample is giving below result:
[$: should be valid to one and only one of the schemas ]
it should point out exact element in json having issue.

@Krishna-capone
Copy link
Contributor

@nggoenka This is the issue referenced and fixed in #366 . The fix has been merged and it should be available in the latest release. Thanks

@nggoenka
Copy link
Author

nggoenka commented Feb 5, 2021

I am getting below error while creating PR.
remote: Permission to networknt/json-schema-validator.git denied to nggoenka.
fatal: unable to access 'https://github.com/networknt/json-schema-validator.git/': The requested URL returned error: 403

@stevehu
Copy link
Contributor

stevehu commented Feb 5, 2021

@nggoenka We have two-factor authentication enabled so HTTPS might not work. Try to switch to SSH when you clone the project if you have the write permission. If you fork the project, I don't know what is going on. It might be Github unavailable at the moment.

@nggoenka
Copy link
Author

nggoenka commented Feb 9, 2021

@Krishna-capone after new release.....Please find below expected error:
$.identifier[0].use1: is not defined in the schema and the schema does not allow additional properties,
instaed of it, I am getting below error:
[$.gender: is not defined in the schema and the schema does not allow additional properties, $.active: is not defined in the schema and the schema does not allow additional properties, $.telecom: is not defined in the schema and the schema does not allow additional properties, $.birthDate: is not defined in the schema and the schema does not allow additional properties, $._birthDate: is not defined in the schema and the schema does not allow additional properties, $.identifier[0].use1: is not defined in the schema and the schema does not allow additional properties, $.name: array found, string expected, $.resourceType: must be a constant value Account, $.resourceType: must be a constant value ActivityDefinition, $.subject: is missing but it is required, $.name: is not defined in the schema and the schema does not allow additional properties, $.patient: is missing but it is required, $.participant: is missing but it is required, $.appointment: is missing but it is required, $.agent: is missing but it is required, $.source: is missing but it is required, $.type: is missing but it is required, $.identifier: is not defined in the schema and the schema does not allow additional properties, $.code: is missing but it is required, $.resourceType: must be a constant value Binary, $.resourceType: must be a constant value BiologicallyDerivedProduct, $.resourceType: must be a constant value Bundle, $.resourceType: must be a constant value CapabilityStatement, $.resourceType: must be a constant value CareTeam, $.referencedItem: is missing but it is required, $.resourceType: must be a constant value ChargeItemDefinition, $.insurance: is missing but it is required, $.provider: is missing but it is required, $.priority: is missing but it is required, $.insurer: is missing but it is required, $.resourceType: must be a constant value CodeSystem, $.resourceType: must be a constant value Communication, $.resourceType: must be a constant value CommunicationRequest, $.resourceType: must be a constant value CompartmentDefinition, $.author: is missing but it is required, $.resourceType: must be a constant value ConceptMap, $.scope: is missing but it is required, $.category: is missing but it is required, $.resourceType: must be a constant value Contract, $.payor: is missing but it is required, $.beneficiary: is missing but it is required, $.request: is missing but it is required, $.resourceType: must be a constant value DetectedIssue, $.resourceType: must be a constant value Device, $.resourceType: must be a constant value DeviceDefinition, $.device: is missing but it is required, $.content: is missing but it is required, $.exposureAlternative: is missing but it is required, $.exposure: is missing but it is required, $.outcome: is missing but it is required, $.population: is missing but it is required, $.class: is missing but it is required, $.payloadType: is missing but it is required, $.connectionType: is missing but it is required, $.resourceType: must be a constant value EnrollmentRequest, $.resourceType: must be a constant value EnrollmentResponse, $.trigger: is missing but it is required, $.exposureBackground: is missing but it is required, $.characteristic: is missing but it is required, $.resourceType: must be a constant value ExampleScenario, $.relationship: is missing but it is required, $.description: is missing but it is required, $.resourceType: must be a constant value GraphDefinition, $.resourceType: must be a constant value Group, $.resourceType: must be a constant value GuidanceResponse, $.resourceType: must be a constant value HealthcareService, $.vaccineCode: is missing but it is required, $.doseStatus: is missing but it is required, $.targetDisease: is missing but it is required, $.immunizationEvent: is missing but it is required, $.recommendation: is missing but it is required, $.resourceType: must be a constant value ImplementationGuide, $.resourceType: must be a constant value InsurancePlan, $.resourceType: must be a constant value Invoice, $.item: is missing but it is required, $.resourceType: must be a constant value List, $.resourceType: must be a constant value Location, $.resourceType: must be a constant value Measure, $.period: is missing but it is required, $.measure: is missing but it is required, $.resourceType: must be a constant value Medication, $.resourceType: must be a constant value MedicationDispense, $.resourceType: must be a constant value MedicationKnowledge, $.name[0].given: is not defined in the schema and the schema does not allow additional properties, $.name[0].use: is not defined in the schema and the schema does not allow additional properties, $.name[0].family: is not defined in the schema and the schema does not allow additional properties, $.name[1].given: is not defined in the schema and the schema does not allow additional properties, $.name[1].use: is not defined in the schema and the schema does not allow additional properties, $.name[2].given: is not defined in the schema and the schema does not allow additional properties, $.name[2].period: is not defined in the schema and the schema does not allow additional properties, $.name[2].use: is not defined in the schema and the schema does not allow additional properties, $.name[2].family: is not defined in the schema and the schema does not allow additional properties, $.resourceType: must be a constant value MedicinalProduct, $.resourceType: must be a constant value MedicinalProductAuthorization, $.resourceType: must be a constant value MedicinalProductContraindication, $.resourceType: must be a constant value MedicinalProductIndication, $.role: is missing but it is required, $.resourceType: must be a constant value MedicinalProductInteraction, $.quantity: is missing but it is required, $.manufacturedDoseForm: is missing but it is required, $.packageItem: is missing but it is required, $.administrableDoseForm: is missing but it is required, $.routeOfAdministration: is missing but it is required, $.resourceType: must be a constant value MedicinalProductUndesirableEffect, $.resourceType: must be a constant value MessageDefinition, $.resourceType: must be a constant value MolecularSequence, $.uniqueId: is missing but it is required, $.resourceType: must be a constant value OperationDefinition, $.issue: is missing but it is required, $.resourceType: must be a constant value Organization, $.resourceType: must be a constant value OrganizationAffiliation, $.resourceType: must be a constant value Parameters, $.amount: is missing but it is required, $.recipient: is missing but it is required, $.payment: is missing but it is required, $.paymentAmount: is missing but it is required, $.resourceType: must be a constant value Person, $.resourceType: must be a constant value PlanDefinition, $.resourceType: must be a constant value Practitioner, $.resourceType: must be a constant value PractitionerRole, $.target: is missing but it is required, $.resourceType: must be a constant value Questionnaire, $.resourceType: must be a constant value QuestionnaireResponse, $.resourceType: must be a constant value RequestGroup, $.resourceType: must be a constant value ResearchStudy, $.study: is missing but it is required, $.individual: is missing but it is required, $.actor: is missing but it is required, $.resourceType: must be a constant value SearchParameter, $.schedule: is missing but it is required, $.resourceType: must be a constant value Specimen, $.resourceType: must be a constant value SpecimenDefinition, $.resourceType: must be a constant value StructureDefinition, $.group: is missing but it is required, $.channel: is missing but it is required, $.resourceType: must be a constant value SubstanceNucleicAcid, $.resourceType: must be a constant value SubstancePolymer, $.resourceType: must be a constant value SubstanceProtein, $.resourceType: must be a constant value SubstanceReferenceInformation, $.resourceType: must be a constant value SubstanceSourceMaterial, $.resourceType: must be a constant value SubstanceSpecification, $.resourceType: must be a constant value SupplyDelivery, $.resourceType: must be a constant value Task, $.resourceType: must be a constant value TerminologyCapabilities, $.testScript: is missing but it is required, $.resourceType: must be a constant value TestScript, $.resourceType: must be a constant value ValueSet, $.resourceType: must be a constant value VerificationResult, $.prescriber: is missing but it is required, $.lensSpecification: is missing but it is required

@nggoenka
Copy link
Author

nggoenka commented Feb 9, 2021

@Krishna-capone after new release.....Please find below expected error:
$.identifier[0].use1: is not defined in the schema and the schema does not allow additional properties,
instaed of it, I am getting below error:
[$.gender: is not defined in the schema and the schema does not allow additional properties, $.active: is not defined in the schema and the schema does not allow additional properties, $.telecom: is not defined in the schema and the schema does not allow additional properties, $.birthDate: is not defined in the schema and the schema does not allow additional properties, $._birthDate: is not defined in the schema and the schema does not allow additional properties, $.identifier[0].use1: is not defined in the schema and the schema does not allow additional properties, $.name: array found, string expected, $.resourceType: must be a constant value Account, $.resourceType: must be a constant value ActivityDefinition, $.subject: is missing but it is required, $.name: is not defined in the schema and the schema does not allow additional properties, $.patient: is missing but it is required, $.participant: is missing but it is required, $.appointment: is missing but it is required, $.agent: is missing but it is required, $.source: is missing but it is required, $.type: is missing but it is required, $.identifier: is not defined in the schema and the schema does not allow additional properties, $.code: is missing but it is required, $.resourceType: must be a constant value Binary, $.resourceType: must be a constant value BiologicallyDerivedProduct, $.resourceType: must be a constant value Bundle, $.resourceType: must be a constant value CapabilityStatement, $.resourceType: must be a constant value CareTeam, $.referencedItem: is missing but it is required, $.resourceType: must be a constant value ChargeItemDefinition, $.insurance: is missing but it is required, $.provider: is missing but it is required, $.priority: is missing but it is required, $.insurer: is missing but it is required, $.resourceType: must be a constant value CodeSystem, $.resourceType: must be a constant value Communication, $.resourceType: must be a constant value CommunicationRequest, $.resourceType: must be a constant value CompartmentDefinition, $.author: is missing but it is required, $.resourceType: must be a constant value ConceptMap, $.scope: is missing but it is required, $.category: is missing but it is required, $.resourceType: must be a constant value Contract, $.payor: is missing but it is required, $.beneficiary: is missing but it is required, $.request: is missing but it is required, $.resourceType: must be a constant value DetectedIssue, $.resourceType: must be a constant value Device, $.resourceType: must be a constant value DeviceDefinition, $.device: is missing but it is required, $.content: is missing but it is required, $.exposureAlternative: is missing but it is required, $.exposure: is missing but it is required, $.outcome: is missing but it is required, $.population: is missing but it is required, $.class: is missing but it is required, $.payloadType: is missing but it is required, $.connectionType: is missing but it is required, $.resourceType: must be a constant value EnrollmentRequest, $.resourceType: must be a constant value EnrollmentResponse, $.trigger: is missing but it is required, $.exposureBackground: is missing but it is required, $.characteristic: is missing but it is required, $.resourceType: must be a constant value ExampleScenario, $.relationship: is missing but it is required, $.description: is missing but it is required, $.resourceType: must be a constant value GraphDefinition, $.resourceType: must be a constant value Group, $.resourceType: must be a constant value GuidanceResponse, $.resourceType: must be a constant value HealthcareService, $.vaccineCode: is missing but it is required, $.doseStatus: is missing but it is required, $.targetDisease: is missing but it is required, $.immunizationEvent: is missing but it is required, $.recommendation: is missing but it is required, $.resourceType: must be a constant value ImplementationGuide, $.resourceType: must be a constant value InsurancePlan, $.resourceType: must be a constant value Invoice, $.item: is missing but it is required, $.resourceType: must be a constant value List, $.resourceType: must be a constant value Location, $.resourceType: must be a constant value Measure, $.period: is missing but it is required, $.measure: is missing but it is required, $.resourceType: must be a constant value Medication, $.resourceType: must be a constant value MedicationDispense, $.resourceType: must be a constant value MedicationKnowledge, $.name[0].given: is not defined in the schema and the schema does not allow additional properties, $.name[0].use: is not defined in the schema and the schema does not allow additional properties, $.name[0].family: is not defined in the schema and the schema does not allow additional properties, $.name[1].given: is not defined in the schema and the schema does not allow additional properties, $.name[1].use: is not defined in the schema and the schema does not allow additional properties, $.name[2].given: is not defined in the schema and the schema does not allow additional properties, $.name[2].period: is not defined in the schema and the schema does not allow additional properties, $.name[2].use: is not defined in the schema and the schema does not allow additional properties, $.name[2].family: is not defined in the schema and the schema does not allow additional properties, $.resourceType: must be a constant value MedicinalProduct, $.resourceType: must be a constant value MedicinalProductAuthorization, $.resourceType: must be a constant value MedicinalProductContraindication, $.resourceType: must be a constant value MedicinalProductIndication, $.role: is missing but it is required, $.resourceType: must be a constant value MedicinalProductInteraction, $.quantity: is missing but it is required, $.manufacturedDoseForm: is missing but it is required, $.packageItem: is missing but it is required, $.administrableDoseForm: is missing but it is required, $.routeOfAdministration: is missing but it is required, $.resourceType: must be a constant value MedicinalProductUndesirableEffect, $.resourceType: must be a constant value MessageDefinition, $.resourceType: must be a constant value MolecularSequence, $.uniqueId: is missing but it is required, $.resourceType: must be a constant value OperationDefinition, $.issue: is missing but it is required, $.resourceType: must be a constant value Organization, $.resourceType: must be a constant value OrganizationAffiliation, $.resourceType: must be a constant value Parameters, $.amount: is missing but it is required, $.recipient: is missing but it is required, $.payment: is missing but it is required, $.paymentAmount: is missing but it is required, $.resourceType: must be a constant value Person, $.resourceType: must be a constant value PlanDefinition, $.resourceType: must be a constant value Practitioner, $.resourceType: must be a constant value PractitionerRole, $.target: is missing but it is required, $.resourceType: must be a constant value Questionnaire, $.resourceType: must be a constant value QuestionnaireResponse, $.resourceType: must be a constant value RequestGroup, $.resourceType: must be a constant value ResearchStudy, $.study: is missing but it is required, $.individual: is missing but it is required, $.actor: is missing but it is required, $.resourceType: must be a constant value SearchParameter, $.schedule: is missing but it is required, $.resourceType: must be a constant value Specimen, $.resourceType: must be a constant value SpecimenDefinition, $.resourceType: must be a constant value StructureDefinition, $.group: is missing but it is required, $.channel: is missing but it is required, $.resourceType: must be a constant value SubstanceNucleicAcid, $.resourceType: must be a constant value SubstancePolymer, $.resourceType: must be a constant value SubstanceProtein, $.resourceType: must be a constant value SubstanceReferenceInformation, $.resourceType: must be a constant value SubstanceSourceMaterial, $.resourceType: must be a constant value SubstanceSpecification, $.resourceType: must be a constant value SupplyDelivery, $.resourceType: must be a constant value Task, $.resourceType: must be a constant value TerminologyCapabilities, $.testScript: is missing but it is required, $.resourceType: must be a constant value TestScript, $.resourceType: must be a constant value ValueSet, $.resourceType: must be a constant value VerificationResult, $.prescriber: is missing but it is required, $.lensSpecification: is missing but it is required

Please find sample code to test here: nggoenka/FhirValidationExample#1

@Krishna-capone
Copy link
Contributor

@nggoenka , My fix is for Oneof Validator. In your schema i did not find any one of validation configured. So the error is not related to one of validation.

@stevehu
Copy link
Contributor

stevehu commented May 30, 2024

@nggoenka Have you had a chance to try the latest version? Let's open a new issue if the issue is not resolved. Thanks.

@stevehu stevehu closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants