Skip to content

chore: add support for entity files node types and validation#2377

Merged
kamil1094 merged 25 commits into
mainfrom
chore/entity-file-types-and-validation
Oct 30, 2025
Merged

chore: add support for entity files node types and validation#2377
kamil1094 merged 25 commits into
mainfrom
chore/entity-file-types-and-validation

Conversation

@kamil1094

@kamil1094 kamil1094 commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

What/Why/How?

Added 2 new methods to support validation and autocompletion of catalog entities files:

  • createEntityTypes - method creating node types for entity files validation and autocompletion
  • lintEntityFile - method for validating entity file, returning problems for single object files and for files containing arrays of entities

Reference

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • All new/updated code is covered by tests
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot

changeset-bot Bot commented Oct 20, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 830ee3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch
@redocly/respect-core Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions

github-actions Bot commented Oct 20, 2025

Copy link
Copy Markdown
Contributor
Command Mean [s] Min [s] Max [s] Relative
redocly lint resources/rebilly.yaml 1.449 ± 0.023 1.418 1.477 1.00
redocly-next lint resources/rebilly.yaml 1.459 ± 0.035 1.436 1.550 1.01 ± 0.03

Comment thread packages/cli/src/__tests__/fixtures/config.ts Outdated
Comment thread packages/core/src/__tests__/consts.ts Outdated
@kamil1094
kamil1094 marked this pull request as ready for review October 24, 2025 13:01
@kamil1094
kamil1094 requested review from a team as code owners October 24, 2025 13:01
Comment thread packages/core/src/__tests__/entity-yaml.test.ts Outdated

@tatomyr tatomyr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks much better. I left a couple of comments, will take another turn tomorrow.

Comment thread packages/core/src/__tests__/lint.test.ts Outdated
Comment thread packages/core/src/rules/common/__tests__/entity-key-valid.test.ts Outdated
Comment thread packages/core/src/rules/common/entity-key-valid.ts Outdated
Comment thread packages/core/src/lint.ts Outdated
Comment thread packages/core/src/__tests__/entity-yaml.test.ts Outdated
Comment thread packages/core/src/lint.ts Outdated

@tatomyr tatomyr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left a comment. Otherwise LGTM.

Comment thread packages/core/src/types/entity-yaml.ts
@github-actions

github-actions Bot commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 78.89% (🎯 78%) 5847 / 7411
🟢 Statements 78.33% (🎯 78%) 6042 / 7713
🟢 Functions 81.99% (🎯 81%) 1202 / 1466
🟢 Branches 71.08% (🎯 70%) 4045 / 5690
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/lint.ts 94.11% 85.29% 100% 94% 107-118, 141
packages/core/src/visitors.ts 92.94% 90.24% 90% 92.5% 497, 534, 537, 558, 590, 604
packages/core/src/rules/catalog-entity/entity-key-valid.ts 100% 100% 100% 100%
packages/core/src/types/entity-yaml.ts 100% 83.33% 100% 100%
Generated in workflow #7886 for commit 830ee3c by the Vitest Coverage Report Action

Comment thread packages/core/src/__tests__/lint.test.ts Outdated
Comment thread packages/core/src/__tests__/entity-yaml.test.ts Outdated

@tatomyr tatomyr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I took another look and found that you used config improperly. Left another portion of comments. Sorry, I didn't notice that in the previous run.

Comment thread packages/core/src/__tests__/lint.test.ts Outdated
Comment thread packages/core/src/lint.ts Outdated
Comment thread packages/core/src/lint.ts Outdated
Comment thread packages/core/src/lint.ts Outdated
Comment thread packages/core/src/lint.ts Outdated
Comment thread packages/core/src/lint.ts Outdated

@tatomyr tatomyr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One more portion of comments, and I think it's fine.

Comment thread packages/core/src/rules/catalog-entity/entity-key-valid.ts
Comment thread packages/core/src/rules/common/entity-key-valid.ts Outdated
@tatomyr

tatomyr commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator

Please confirm you've checked the changes in our internal products, and check other checkmarks if needed:

image

@tatomyr tatomyr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left minor comments. Otherwise looks good.

Comment thread packages/core/src/rules/catalog-entity/entity-key-valid.ts
Comment thread packages/core/src/rules/catalogEntity/__tests__/entity-key-valid.test.ts Outdated
Comment thread packages/core/src/__tests__/lint.test.ts Outdated
Comment thread packages/core/src/index.ts Outdated
@kamil1094
kamil1094 merged commit b51c4b3 into main Oct 30, 2025
41 checks passed
@kamil1094
kamil1094 deleted the chore/entity-file-types-and-validation branch October 30, 2025 07:28
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