···11+---
22+"@hey-api/openapi-ts": patch
33+---
44+55+feat(parser): input supports ReadMe API Registry with `readme:` prefix
+36
docs/openapi-ts/configuration/input.md
···5252If you use an HTTPS URL with a self-signed certificate in development, you will need to set [`NODE_TLS_REJECT_UNAUTHORIZED=0`](https://github.com/hey-api/openapi-ts/issues/276#issuecomment-2043143501) in your environment.
5353:::
54545555+### ReadMe API Registry
5656+5757+You can use ReadMe API Registry UUIDs to fetch OpenAPI specifications directly from ReadMe's platform. This is useful when API providers use ReadMe as their source of truth for API documentation.
5858+5959+::: code-group
6060+6161+```js [simple format]
6262+export default {
6363+ input: 'readme:abc123def456', // [!code ++]
6464+};
6565+```
6666+6767+```js [full format]
6868+export default {
6969+ input: 'readme:@organization/project#abc123def456', // [!code ++]
7070+};
7171+```
7272+7373+```js [object format]
7474+export default {
7575+ input: {
7676+ path: 'readme:abc123def456', // [!code ++]
7777+ // ...other options
7878+ },
7979+};
8080+```
8181+8282+:::
8383+8484+The ReadMe input formats are:
8585+8686+- `readme:uuid` - Simple format using only the UUID
8787+- `readme:@organization/project#uuid` - Full format including organization and project names
8888+8989+Both formats will fetch the OpenAPI specification from `https://dash.readme.com/api/v1/api-registry/{uuid}`.
9090+5591### Hey API Platform options
56925793You might want to use the [Hey API Platform](/openapi-ts/integrations) to store your specifications. If you do so, the `input` object provides options to help with constructing the correct URL.
···11import type { Config, UserConfig } from '../types/config';
22+import { isReadmeInput, transformReadmeInput } from '../utils/readme';
2334const defaultWatch: Config['input']['watch'] = {
45 enabled: false,
···3839 };
39404041 if (typeof userConfig.input === 'string') {
4141- input.path = userConfig.input;
4242+ // Handle ReadMe input format transformation
4343+ if (isReadmeInput(userConfig.input)) {
4444+ input.path = transformReadmeInput(userConfig.input);
4545+ } else {
4646+ input.path = userConfig.input;
4747+ }
4248 } else if (
4349 userConfig.input &&
4450 (userConfig.input.path !== undefined ||
···5056 path: 'https://get.heyapi.dev',
5157 ...userConfig.input,
5258 };
5959+6060+ // Handle ReadMe input format transformation when path is specified
6161+ if (typeof input.path === 'string' && isReadmeInput(input.path)) {
6262+ input.path = transformReadmeInput(input.path);
6363+ }
53645465 // watch only remote files
5566 if (input.watch !== undefined) {
+8-2
packages/openapi-ts/src/types/config.d.ts
···1818 */
1919 dryRun?: boolean;
2020 /**
2121- * Path to the OpenAPI specification. This can be either local or remote path.
2121+ * Path to the OpenAPI specification. This can be either:
2222+ * - local file
2323+ * - remote path
2424+ * - ReadMe API Registry UUID (full and simplified formats)
2525+ *
2226 * Both JSON and YAML file formats are supported. You can also pass the parsed
2327 * object directly if you're fetching the file yourself.
2428 *
2529 * Alternatively, you can define a configuration object with more options.
2630 */
2731 input:
2828- | 'https://get.heyapi.dev/<organization>/<project>'
3232+ | `https://get.heyapi.dev/${string}/${string}`
3333+ | `readme:@${string}/${string}#${string}`
3434+ | `readme:${string}`
2935 | (string & {})
3036 | (Record<string, unknown> & { path?: never })
3137 | Input;
+8-2
packages/openapi-ts/src/types/input.d.ts
···3636 */
3737 organization?: string;
3838 /**
3939- * Path to the OpenAPI specification. This can be either local or remote path.
3939+ * Path to the OpenAPI specification. This can be either:
4040+ * - local file
4141+ * - remote path
4242+ * - ReadMe API Registry UUID (full and simplified formats)
4343+ *
4044 * Both JSON and YAML file formats are supported. You can also pass the parsed
4145 * object directly if you're fetching the file yourself.
4246 */
4347 path?:
4444- | 'https://get.heyapi.dev/<organization>/<project>'
4848+ | `https://get.heyapi.dev/${string}/${string}`
4949+ | `readme:@${string}/${string}#${string}`
5050+ | `readme:${string}`
4551 | (string & {})
4652 | Record<string, unknown>;
4753 /**