Skip to content

Conversation

@candidosales
Copy link

@candidosales candidosales commented Nov 23, 2025

What does it do?

This pull request introduces enhanced support for relation fields—especially "ToMany" (array) relations—in the URL pattern service, along with expanded test coverage and updates to content type schemas to reflect these capabilities. The changes improve how URL patterns can reference and resolve fields within related entities, including those with array indices and dashed/underscored relation names. Additionally, editor and VSCode configuration files are updated for consistency and improved developer experience.

Enhancements to URL Pattern Service:

  • Added support for "ToMany" (array) relations in allowed fields and pattern resolution, enabling URL patterns like [categories[0].slug] and handling both dashed and underscored relation names. [1] [2]
  • Improved pattern field extraction and relation detection to handle array indices and special characters, ensuring accurate validation and resolution of complex patterns. [1] [2] [3]

Testing Improvements:

  • Introduced comprehensive tests for the URL pattern service, covering allowed fields, pattern resolution (including array and relation syntax), validation, and relation extraction.

Schema Updates:

  • Updated private-category and test content type schemas to use many-to-many relations, added url_alias relations, and improved field naming consistency. [1] [2]

Developer Experience:

  • Added .editorconfig and VSCode extension recommendations to enforce consistent code style and encourage use of EditorConfig. [1] [2]
  • Minor cleanup in schema options for the test content type.

Why is it needed?

Describe the issue you are solving.

How to test it?

Running the application using bun run playground:develop or npm run playground:develop

CleanShot.2025-11-23.at.11.32.16.mp4

Add validation when the user omits the array index.

CleanShot 2025-11-23 at 12 10 35@2x

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2025

⚠️ No Changeset found

Latest commit: c31162c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@candidosales candidosales changed the title [POC] feat: Implement support for ToMany relation array syntax in URL patte… [POC] feat: Implement support for ToMany relation array syntax in URL patterns Nov 23, 2025
@@ -0,0 +1,5 @@
{
"recommendations": [
"editorconfig.editorconfig"
Copy link
Author

Choose a reason for hiding this comment

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

Added this recommendation file to remind the developer to install EditorConfig and set up tab-size indentation.

@candidosales candidosales marked this pull request as ready for review November 23, 2025 16:38
@candidosales candidosales changed the title [POC] feat: Implement support for ToMany relation array syntax in URL patterns feat: Implement support for ToMany relation array syntax in URL patterns Nov 23, 2025
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