Skip to content

Add minItems and maxItems to JSON schema - #388

Open
Markus1812 wants to merge 1 commit into
mainfrom
add-min-max-items-json-schema
Open

Markus1812 wants to merge 1 commit into
mainfrom
add-min-max-items-json-schema

Conversation

@Markus1812

Copy link
Copy Markdown
Member

Summary

Adds support for the \` and \` ABAP Doc annotations on internal tables. These are emitted as \minItems` / \maxItems` constraints for array types in the generated JSON schema, analogous to the existing \minLength` / \maxLength` handling for strings.

Changes

  • zcl_aff_abap_doc_parser: added \min_items` / \max_items` annotation constants and result fields, included them in the description-boundary regex, and routed them through \parse_number_annotations`.
  • zcl_aff_writer: extended \compare_abap_doc` to merge \min_items` / \max_items`.
  • zcl_aff_writer_json_schema: emit \minItems` / \maxItems` in both \open_table` and \open_json_schema_for_table`.

Tests

  • Added \min_max_items` parser test.
  • Added \my_table_with_item_bounds` fixture type annotated with \ 1` / \ 5`.
  • Added \min_max_items` writer test asserting the emitted schema.

Note: unlike \maxLength` (which can also be derived from DDIC), \minItems`/\maxItems` only come from the ABAP Doc annotations. ABAP Unit tests should be run in an ABAP system to verify.

Support the \ and \ ABAP Doc annotations on internal
tables. These are emitted as minItems / maxItems constraints for array
types in the generated JSON schema.

- Parse the new annotations in zcl_aff_abap_doc_parser
- Merge them in zcl_aff_writer~compare_abap_doc
- Write them in open_table and open_json_schema_for_table
- Add parser and writer unit tests
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Control Panel

Hi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
To interact with me, just use the following actions:

  • 📝 Summarize PR
  • 🔍 Review
  • 🗑️ Delete all bot comments and reviews

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

Successfully merging this pull request may close these issues.

1 participant