Skip to content

[CHKO] category and class must contain valid values#746

Open
larshp wants to merge 1 commit intomainfrom
hvam/chko2403
Open

[CHKO] category and class must contain valid values#746
larshp wants to merge 1 commit intomainfrom
hvam/chko2403

Conversation

@larshp
Copy link
Collaborator

@larshp larshp commented Mar 24, 2026

don't allow empty values or lower case or strange characters

@larshp larshp changed the title CHKO: category and class must contain valid values [CHKO]: category and class must contain valid values Mar 24, 2026
@larshp larshp changed the title [CHKO]: category and class must contain valid values [CHKO] category and class must contain valid values Mar 24, 2026
@larshp larshp requested a review from Copilot March 24, 2026 08:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds stricter validation for CHKO “category” and “implementing class” fields to reject empty values, lowercase, and unexpected characters, aligning the CHKO file format with expected ABAP naming constraints.

Changes:

  • Added $pattern annotations for category and implementing_class in zif_aff_chko_v1 (ABAP interface metadata).
  • Updated the generated JSON schema (chko-v1.json) to include the same pattern constraints for category and implementingClass.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
file-formats/chko/type/zif_aff_chko_v1.intf.abap Adds regex-based constraints via $pattern for CHKO name-like fields.
file-formats/chko/chko-v1.json Enforces the same constraints at JSON schema level for CHKO consumers/validators.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@larshp larshp marked this pull request as ready for review March 24, 2026 08:16
@schneidermic0
Copy link
Contributor

Did you have CHKO specifically in mind? If we want to add the pattern, I am wondering whether we should add it to zif_aff_types_v1=>ty_object_name_30 in general. This would update all places, but we must regenerate all schemas...

@SAP/abap-file-formats-team What do you think?

@albertmink
Copy link
Contributor

If the pattern is used for validate input in Eclipse UIs, then this is bad and this will break.

@schneidermic0
Copy link
Contributor

If the pattern is used for validate input in Eclipse UIs, then this is bad and this will break.

Why would be a validation of the schema be bad? Do you have unspecific error message in mind? Or that input is limited (as we had it for a while for numerics)?

@albertmink
Copy link
Contributor

Had a brief chat with @wurzka and we think the JSON Schema pattern feature can be used. So, we can (maybe should) make the JSON Schema more specific.
For our internal consumption and design, we think it is important that we clearly state that the pattern doesn't result in any kind of UI input validation. In the past there was confusion and colleagues were miss guided.

@larshp
Copy link
Collaborator Author

larshp commented Mar 25, 2026

the regex itself is not perfect, and cannot contain all the validations, but it will help preventing inputting obviously wrong values

like these two values,
image

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.

4 participants