hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.04k stars 1.33k forks source link

Please document how the validator works #2469

Open bionicles opened 3 years ago

bionicles commented 3 years ago

Describe the issue I want to understand how the validate function works, but I got lost in all the class inheritance and couldn't find exactly where this happens in the codebase.

Would you please be openminded to document:

Environment (please complete the following information):

Additional context FhirInstanceValidator.validate method - https://github.com/hapifhir/hapi-fhir/blob/2633cbd1415bb9a72e4d1a7feab6587709e18ffe/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/FhirInstanceValidator.java#L222

FhirInstanceValidator.validate invokes ValidatorWrapper.validate - https://github.com/hapifhir/hapi-fhir/blob/2633cbd1415bb9a72e4d1a7feab6587709e18ffe/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/ValidatorWrapper.java#L104

ValidatorWrapper.validate invokes InstanceValidator.validate - https://github.com/hapifhir/hapi-fhir/blob/2633cbd1415bb9a72e4d1a7feab6587709e18ffe/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/ValidatorWrapper.java#L104

Where is the code for InstanceValidator.validate? import org.hl7.fhir.validation.instance.InstanceValidator;

https://hapifhir.io/hapi-fhir/docs/validation/instance_validator.html

Might be a dumb question, but clarity can help newcomers contribute to the codebase

bionicles commented 3 years ago

found InstanceValidator: https://github.com/hapifhir/org.hl7.fhir.core/blob/76112af3c7296d09187f5c1e424602eac00d6483/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java#L186