Last active
August 28, 2025 09:45
-
-
Save ybiquitous/65f7e5491f8b40c384561c4f96dd58cb to your computer and use it in GitHub Desktop.
redocly-cli v2.0.7 bug reproduction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openapi: '3.1.0' | |
| info: | |
| title: Example API | |
| version: '1.0.0' | |
| license: | |
| name: MIT | |
| servers: | |
| - url: https://api.example.com/v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openapi: '3.1.0' | |
| paths: | |
| /items: | |
| get: | |
| summary: Retrieve a list of items | |
| responses: | |
| '200': | |
| description: A list of items | |
| content: | |
| application/json: | |
| schema: | |
| type: array | |
| items: | |
| type: string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "module", | |
| "dependencies": { | |
| "@redocly/cli": "2.0.7" | |
| }, | |
| "scripts": { | |
| "join": "redocly join --without-x-tag-groups a.yml b.yml -o tmp.yml", | |
| "bundle": "redocly bundle tmp.yml -o openapi.yml", | |
| "postbundle": "rm -f tmp.yml", | |
| "lint": "redocly lint openapi.yml --skip-rule security-defined", | |
| "test": "npm run join && npm run bundle && npm run lint" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function plugin() { | |
| return { | |
| id: "my-plugin", | |
| decorators: { | |
| oas3: { | |
| "add-servers": addServers, | |
| }, | |
| }, | |
| }; | |
| } | |
| const addServers = () => ({ | |
| Root: { | |
| leave: (root) => { | |
| root.servers = [ | |
| { | |
| url: "https://api.example.com/v1", | |
| }, | |
| ]; | |
| }, | |
| }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| decorators: | |
| my-plugin/add-servers: on | |
| plugins: | |
| - plugin.js | |
| extends: | |
| - recommended |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding a customer decorator and running
redocly bundlecan work around the problem. Note thatserversina.ymlis ignored.Run:
Output
openapi.yml:Ref https://redocly.com/docs/cli/guides/replace-servers-url