Skip to content

fix: performance issue when dereferencing circular schemas #1020

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

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"js-yaml": "^4.1.0",
"license": "^1.0.3",
"lodash-es": "^4.17.21",
"oas": "^26.0.1",
"oas-normalize": "^13.1.0",
"oas": "^27.0.0",
"oas-normalize": "^14.0.0",
"ora": "^8.0.1",
"preferred-pm": "^4.0.0",
"prompts": "^2.4.2",
Expand All @@ -72,7 +72,7 @@
},
"devDependencies": {
"@api/test-utils": "file:../test-utils",
"@readme/oas-examples": "^5.19.1",
"@readme/oas-examples": "^6.0.0",
"@types/js-yaml": "^4.0.9",
"@types/lodash-es": "^4.17.12",
"@types/prompts": "^2.4.9",
Expand Down
4 changes: 2 additions & 2 deletions packages/api/test/fetcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('fetcher', () => {

await expect(fetcher.load()).resolves.toHaveProperty('info', {
description: 'Create beautiful product and API documentation with our developer friendly platform.',
version: '4.355.0',
version: '5.319.0',
title: 'ReadMe API 🦉',
contact: {
name: 'API Support',
Expand All @@ -164,7 +164,7 @@ describe('fetcher', () => {

await expect(fetcher.load()).resolves.toHaveProperty('info', {
description: 'Create beautiful product and API documentation with our developer friendly platform.',
version: '4.355.0',
version: '5.319.0',
title: 'ReadMe API 🦉',
contact: {
name: 'API Support',
Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/lib/suggestedOperations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('#getSuggestedOperation', () => {
const suggested = getSuggestedOperation(spec);

expect(suggested).toBeInstanceOf(Operation);
expect((suggested as Operation).getOperationId()).toBe('getAPISpecification');
expect((suggested as Operation).getOperationId()).toBe('getProject');
});

it('should not retrieve an operation from a spec thats only comprised of webhooks', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ describe('storage', () => {
private: true,
identifier: 'readme',
source: file,
integrity: 'sha512-rcaq4j4BzMyR9n3kLRTDLbOg37QdNywj2e3whoK/J/6PNlHrLATvysfJVHq+kMBf+gkukUwxayCwbN0wZj8ysg==',
integrity: 'sha512-0oWnrEtFj8tH3RcDQCnls+emnD2hHft4KHPI1L3XFy9p5Ue3n9EXr96P3XR36zHxevtB2RJKAtVM34kq6b8UUQ==',
installerVersion: PACKAGE_VERSION,
language: 'js',
createdAt: expect.any(String),
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@
"node": ">=20.10.0"
},
"dependencies": {
"@readme/oas-to-har": "^25.0.1",
"@readme/oas-to-har": "^26.0.0",
"caseless": "^0.12.0",
"datauri": "^4.1.0",
"fetch-har": "^11.0.1",
"json-schema-to-ts": "^3.0.0",
"json-schema-traverse": "^1.0.0",
"lodash.merge": "^4.6.2",
"oas": "^26.0.1",
"oas": "^27.0.0",
"remove-undefined-objects": "^6.0.0"
},
"devDependencies": {
"@api/test-utils": "file:../test-utils",
"@readme/oas-examples": "^5.19.1",
"@readme/oas-examples": "^6.0.0",
"@types/caseless": "^0.12.5",
"@types/lodash.merge": "^4.6.9",
"@vitest/coverage-v8": "^3.0.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/httpsnippet-client-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
},
"peerDependencies": {
"@readme/httpsnippet": "^11.0.0",
"oas": "^26.0.1"
"oas": "^27.0.0"
},
"devDependencies": {
"@readme/oas-examples": "^5.19.1",
"@readme/oas-examples": "^6.0.0",
"@types/content-type": "^1.1.8",
"@types/stringify-object": "^4.0.5",
"@vitest/coverage-v8": "^3.0.5",
"camelcase": "^8.0.0",
"jest-expect-openapi": "^2.0.1",
"jest-expect-openapi": "^3.0.0",
"stringify-object": "^5.0.0",
"typescript": "^5.8.2",
"vitest": "^3.0.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@types/caseless": "^0.12.3",
"oas": "^26.0.1",
"oas": "^27.0.0",
"typescript": "^5.8.2"
},
"prettier": "@readme/eslint-config/prettier"
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/readme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This SDK was autogenerated by the [`api` SDK generator](https://api.readme.dev),
import readme from '@api/readme';

readme.auth('username', 'password');
readme.getAPISpecification()
readme.getProject()
.then(({ data }) => console.log(data))
.catch(err => console.error(err));
```
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/sdks/readme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api/readme",
"version": "4.355.0",
"version": "5.319.0",
"type": "module",
"main": "dist/index.cjs",
"types": "dist/index.d.cts",
Expand Down
6 changes: 5 additions & 1 deletion packages/test-utils/sdks/readme/src/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Apply from './schemas/Apply.js';
import AskOwlbot from './schemas/AskOwlbot.js';
import Category from './schemas/Category.js';
import Changelog from './schemas/Changelog.js';
import CondensedProjectData from './schemas/CondensedProjectData.js';
Expand Down Expand Up @@ -53,10 +54,12 @@ import GetCustomPage from './schemas/GetCustomPage.js';
import GetCustomPages from './schemas/GetCustomPages.js';
import GetDoc from './schemas/GetDoc.js';
import GetOpenRoles from './schemas/GetOpenRoles.js';
import GetOutboundIPs from './schemas/GetOutboundIPs.js';
import GetProductionDoc from './schemas/GetProductionDoc.js';
import GetProject from './schemas/GetProject.js';
import GetVersion from './schemas/GetVersion.js';
import GetVersions from './schemas/GetVersions.js';
import IpListEntry from './schemas/IpListEntry.js';
import JobOpening from './schemas/JobOpening.js';
import SearchDocs from './schemas/SearchDocs.js';
import UpdateApiSpecification from './schemas/UpdateApiSpecification.js';
Expand All @@ -66,5 +69,6 @@ import UpdateCustomPage from './schemas/UpdateCustomPage.js';
import UpdateDoc from './schemas/UpdateDoc.js';
import UpdateVersion from './schemas/UpdateVersion.js';
import UploadApiSpecification from './schemas/UploadApiSpecification.js';
import ValidateApiSpecification from './schemas/ValidateApiSpecification.js';
import Version from './schemas/Version.js';
export { Apply, Category, Changelog, CondensedProjectData, CreateCategory, CreateCustomPage, CreateDoc, CreateVersion, CustomPage, DeleteApiSpecification, DeleteCategory, DeleteChangelog, DeleteCustomPage, DeleteDoc, DeleteVersion, DocSchemaPost, DocSchemaPut, DocSchemaResponse, ErrorApikeyEmpty, ErrorApikeyMismatch, ErrorApikeyNotfound, ErrorCategoryInvalid, ErrorCategoryNotfound, ErrorCustompageInvalid, ErrorCustompageNotfound, ErrorDocInvalid, ErrorDocNotfound, ErrorRegistryNotfound, ErrorSpecFileEmpty, ErrorSpecIdDuplicate, ErrorSpecIdInvalid, ErrorSpecInvalid, ErrorSpecInvalidSchema, ErrorSpecNotfound, ErrorSpecTimeout, ErrorSpecVersionNotfound, ErrorVersionCantDemoteStable, ErrorVersionCantRemoveStable, ErrorVersionDuplicate, ErrorVersionEmpty, ErrorVersionForkEmpty, ErrorVersionForkNotfound, ErrorVersionNotfound, GetApiRegistry, GetApiSchema, GetApiSpecification, GetCategories, GetCategory, GetCategoryDocs, GetChangelog, GetChangelogs, GetCustomPage, GetCustomPages, GetDoc, GetOpenRoles, GetProductionDoc, GetProject, GetVersion, GetVersions, JobOpening, SearchDocs, UpdateApiSpecification, UpdateCategory, UpdateChangelog, UpdateCustomPage, UpdateDoc, UpdateVersion, UploadApiSpecification, Version }
export { Apply, AskOwlbot, Category, Changelog, CondensedProjectData, CreateCategory, CreateCustomPage, CreateDoc, CreateVersion, CustomPage, DeleteApiSpecification, DeleteCategory, DeleteChangelog, DeleteCustomPage, DeleteDoc, DeleteVersion, DocSchemaPost, DocSchemaPut, DocSchemaResponse, ErrorApikeyEmpty, ErrorApikeyMismatch, ErrorApikeyNotfound, ErrorCategoryInvalid, ErrorCategoryNotfound, ErrorCustompageInvalid, ErrorCustompageNotfound, ErrorDocInvalid, ErrorDocNotfound, ErrorRegistryNotfound, ErrorSpecFileEmpty, ErrorSpecIdDuplicate, ErrorSpecIdInvalid, ErrorSpecInvalid, ErrorSpecInvalidSchema, ErrorSpecNotfound, ErrorSpecTimeout, ErrorSpecVersionNotfound, ErrorVersionCantDemoteStable, ErrorVersionCantRemoveStable, ErrorVersionDuplicate, ErrorVersionEmpty, ErrorVersionForkEmpty, ErrorVersionForkNotfound, ErrorVersionNotfound, GetApiRegistry, GetApiSchema, GetApiSpecification, GetCategories, GetCategory, GetCategoryDocs, GetChangelog, GetChangelogs, GetCustomPage, GetCustomPages, GetDoc, GetOpenRoles, GetOutboundIPs, GetProductionDoc, GetProject, GetVersion, GetVersions, IpListEntry, JobOpening, SearchDocs, UpdateApiSpecification, UpdateCategory, UpdateChangelog, UpdateCustomPage, UpdateDoc, UpdateVersion, UploadApiSpecification, ValidateApiSpecification, Version }
10 changes: 1 addition & 9 deletions packages/test-utils/sdks/readme/src/schemas/Apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@ const Apply = {
},
"job": {
"type": "string",
"description": "The job you're looking to apply for (https://readme.com/careers).",
"enum": [
"Front End Engineer",
"Full Stack Engineer",
"Head of Product",
"Head of Solutions Engineering",
"Product Designer"
],
"default": "Front End Engineer"
"description": "The job you're looking to apply for (https://readme.com/careers)."
},
"pronouns": {
"type": "string",
Expand Down
Loading