pyx12.errh_json¶
Generates a JSON document of validation errors. Visitor - Visits an error_handler composite (issue #50).
Classes¶
Visit an error_handler composite. Accumulate a nested dict mirroring |
Module Contents¶
- class pyx12.errh_json.errh_json_visitor(fd, indent=2)[source]¶
Bases:
pyx12.error_visitor.error_visitorVisit an error_handler composite. Accumulate a nested dict mirroring the ISA / GS / ST / segment / element hierarchy and dump it once as JSON in visit_root_post.
Streaming JSON during the walk would require closing arrays mid-walk; the err_handler tree always fits in memory for any X12 document, so accumulate-then-dump is the right shape.
- Parameters:
fd (file descriptor) – target file
indent (int | None) – json.dump indent argument; pass None for compact output
- visit_root_post(errh)[source]¶
- Parameters:
errh (L{error_handler.err_handler}) – Error handler
- Return type:
None
- visit_isa_pre(err_isa)[source]¶
- Parameters:
err_isa (L{error_handler.err_isa}) – ISA error node
- Return type:
None
- visit_isa_post(err_isa)[source]¶
Params: err_isa - error_isa instance
- Parameters:
err_isa (Any)
- Return type:
None
- visit_gs_post(err_gs)[source]¶
Params: err_gs - error_gs instance
- Parameters:
err_gs (Any)
- Return type:
None
- visit_st_post(err_st)[source]¶
Params: err_st - error_st instance
- Parameters:
err_st (Any)
- Return type:
None