Idea for Introducing "oneOf" - #798
Conversation
Co-authored-by: hyperspace-insights[bot] <209611008+hyperspace-insights[bot]@users.noreply.github.com>
Control PanelHi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
|
There was a problem hiding this comment.
The example code in the new section is missing shorttext title annotations on struct types and fields, which contradicts the documentation standards enforced throughout the rest of this file. Please address the flagged annotation gaps before merging.
PR Bot Information
Version: 1.26.0
- File Content Strategy: Full file content
- Agent Instructions:
- Correlation ID:
c48c7bf2-48ee-4248-838f-f16bbbf32974 - LLM:
anthropic--claude-4.6-sonnet - Event Trigger:
issue_comment.edited - Review Focus Files:
There was a problem hiding this comment.
The new "Union Types (oneOf)" section introduces a useful and well-structured feature, but has several concrete issues: the ABAP example and the generated JSON Schema are inconsistent (a default value appears in the JSON with no corresponding $default annotation in ABAP), the Table of Contents is not updated, and the JSON output silently omits the formatVersion/header fields that are explicitly $required in the ABAP source. Please address these before merging.
PR Bot Information
Version: 1.26.0
- LLM:
anthropic--claude-4.6-sonnet - Review Focus Files:
- Event Trigger:
issue_comment.edited - File Content Strategy: Full file content
- Agent Instructions:
- Correlation ID:
d5010ea8-829e-493b-a3e6-9a81975bd522
wurzka
left a comment
There was a problem hiding this comment.
I like the approach 👍
We have so many object types with components that are only required dependent on some boolean or enum value.
Having a better validation option in the schema is an improvement.
|
Otherwise it is not mutual exclusive and Apart from that, looks really good, also with the |
DISCLAIMER This is just an idea. I share it to get some feedback here.
Introduce
oneOf(Union Types) Documentation for ABAP File FormatsNew Features
✨ Added documentation for a new
oneOfunion type feature in ABAP file formats, enabling developers to model mutually exclusive alternatives in JSON files using ABAP Doc annotations.Changes
docs/json.md: Added a new section "Union Types (oneOf)" covering:$oneOfGroup,$oneOfDiscriminatorFor, and$oneOfValuewith supported syntax variants (plain names and{@link ...}references)$enumValueor camel-case transformation)payload_variantgroupconstconstraints andrequiredfields per branchoneOfis enforced at the JSON Schema validation layer, not at the ABAP transformation layeroneOfconstraints are typically incompatible and require bumpingformatVersionPR Bot Information
Version:
1.26.0issue_comment.editedc09bcdb9-b7dd-4972-97c4-20d8feb9fd13