Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add typings and interfaces for Overlay Specification v1.0.0 #1775

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremyfiel
Copy link
Contributor

related #1246

What/Why/How?

Provides typings and interfaces for a structured Overlay description per the https://github.com/OAI/Overlay-Specification

Hopefully this is the first step to providing support for this new specification!

Can't wait to see what you build!

Reference

https://github.com/OAI/Overlay-Specification/releases/tag/1.0.0

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

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

@jeremyfiel jeremyfiel requested a review from a team as a code owner October 17, 2024 20:41
Copy link

changeset-bot bot commented Oct 17, 2024

🦋 Changeset detected

Latest commit: 1675a9c

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

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Minor
@redocly/cli Minor

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

@jeremyfiel jeremyfiel force-pushed the feat/overlay-v1-typings branch from f401f1e to a48e89f Compare October 17, 2024 20:46
@jeremyfiel jeremyfiel requested a review from a team as a code owner October 17, 2024 20:46
@jeremyfiel jeremyfiel force-pushed the feat/overlay-v1-typings branch from a48e89f to d42c201 Compare October 17, 2024 21:04
@jeremyfiel jeremyfiel force-pushed the feat/overlay-v1-typings branch from d42c201 to ddfc391 Compare October 28, 2024 14:54
@jeremyfiel
Copy link
Contributor Author

thanks for review. I actually missed using the defined NodeType references, so I updated those.

@jeremyfiel jeremyfiel force-pushed the feat/overlay-v1-typings branch from ddfc391 to cb491c0 Compare October 28, 2024 15:00
* updated references to use defined NodeTypes.
* update `any` to `unknown`
* run prettier

related Redocly#1246
@jeremyfiel jeremyfiel force-pushed the feat/overlay-v1-typings branch from cb491c0 to 1675a9c Compare October 28, 2024 15:00
Copy link
Contributor

@tatomyr tatomyr left a comment

Choose a reason for hiding this comment

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

You are actually a step away from implementing overlays linting. All you need to do is extend detectSpec to recognize overlay files and add a couple of corresponding overlay sections in rules, decorators, and preprocessors. If you decide to give it a try, feel free to ping me whenever you need any guidance.

NB: There is a big refactoring PR coming up, so please postpone updating this PR until it's merged (should be merged quite soon).

"@redocly/cli": minor
---

Add typings and interfaces for Overlay Specification v1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Add typings and interfaces for Overlay Specification v1.0.0
Added typings and interfaces for Overlay Specification v1.0.0.

extensionsPrefix: 'x-',
};

export const OverlayTypes: Record<string, NodeType | NormalizedScalarSchema> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const OverlayTypes: Record<string, NodeType | NormalizedScalarSchema> = {
export const OverlayTypes: Record<string, NodeType> = {

Comment on lines +23 to +26
const Extends: NormalizedScalarSchema = {
type: 'string',
resolvable: true,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const Extends: NormalizedScalarSchema = {
type: 'string',
resolvable: true,
};

export const OverlayTypes: Record<string, NodeType | NormalizedScalarSchema> = {
Root,
Info,
Extends,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Extends,

properties: {
overlay: { type: 'string' },
info: 'Info',
extends: 'Extends',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
extends: 'Extends',
extends: { type: 'string' },

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.

3 participants