Skip to content

Issue with keys containing "-" due to schema changes in PR #82 affecting ACF and WP Post properties merging #90

@Zmetser

Description

@Zmetser

Description

Before the changes introduced in PR #82, properties from ACF and WP Post properties that shared keys with "-" in their names were merged under the same key in the generated schema.

After the changes in this PR, instead of merging under the same key, a new separate key is added specifically for the WP Post properties.

Example for before

{
  "components": {
    "schemas": {
      "foo-bar": {
        "title": "Foo Bar",
        "type": "object",
        "properties": {
          // WP Core
          "slug": {
            "description": "An alphanumeric identifier for the post unique to its type.",
            "type": "string"
          },
          "title": { ... },
          ...
          // ACF
          "topper": { ...},
          "credits": { ... }
        }
    }
  }
}

Example for after

Observe how what was unified under foo-bar before, now separated under two keys foo-bar and foo_bar

{
  "components": {
    "schemas": {
      // WP Core
      "foo_bar": {
        "title": "Foo Bar",
        "type": "object",
        "properties": {
          "slug": {
            "description": "An alphanumeric identifier for the post unique to its type.",
            "type": "string"
          },
          "title": { ... },
      },
      // ACF
      "foo-bar": {
        "topper": { ... },
        "credits": { ... }
      }
    }
  }
}

Expected Behavior

Previously, both ACF and WP Post properties with matching keys (including those containing "-") were included together under a single schema key (e.g., "foo-bar"). This merging made it possible to interact with all related fields in one place.

Actual Behavior

After PR #82, these properties are now split into separate schema entries, such as "foo-bar" for ACF and "foo_bar" for WP Core, resulting in fragmentation and possible breaking changes for users expecting the unified schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions