Skip to content

Simplify pattern properties UI#43

Closed
lovasoa wants to merge 2 commits into
mainfrom
pattern-properties
Closed

Simplify pattern properties UI#43
lovasoa wants to merge 2 commits into
mainfrom
pattern-properties

Conversation

@lovasoa
Copy link
Copy Markdown
Owner

@lovasoa lovasoa commented May 21, 2026

closes #33

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 21, 2026

Deploying jsonjoy-builder with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5ae5b30
Status: ✅  Deploy successful!
Preview URL: https://02835608.jsonjoy-builder.pages.dev
Branch Preview URL: https://pattern-properties.jsonjoy-builder.pages.dev

View logs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

const handleNameSubmit = () => {
const trimmedName = tempName.trim();
if (trimmedName && trimmedName !== name) {
onNameChange(trimmedName);

P2 Badge Reject invalid regex names when renaming pattern properties

Pattern-property names are regexes, but rename submission forwards any non-empty string directly to onNameChange without validating it. In PatternSchemaPropertyEditor, this allows editing a valid pattern into an invalid one (for example (), which writes an invalid patternProperties key into the schema and can break downstream validator compilation (e.g., AJV). The add-flow already validates regex syntax, so the edit-flow should enforce the same check before applying the rename.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

newName,
propertySchemaObj,
);
onChange(renameObjectProperty(normalizedSchema, oldName, newName));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve renamed field when target name already exists

This rename path now calls renameObjectProperty directly, which rebuilds the object by key iteration; if newName already exists, whichever key is encountered last wins. In nested object editing this means renaming a to b can silently drop the renamed field schema (or overwrite the existing one depending on order), producing inconsistent data-loss behavior from a single name edit. The previous flow updated the renamed key explicitly before removal, so this regression should be guarded by duplicate-name validation or a deterministic merge policy.

Useful? React with 👍 / 👎.

@piotrcieslak
Copy link
Copy Markdown
Contributor

a toggle to move pattern property to properties and likewise would be helpful

@lovasoa lovasoa closed this May 22, 2026
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.

2 participants