Skip to content

Follow refs when generating definitions#174

Merged
willosborne merged 14 commits intofinos:mainfrom
willosborne:generate-ref-lookup
Apr 29, 2024
Merged

Follow refs when generating definitions#174
willosborne merged 14 commits intofinos:mainfrom
willosborne:generate-ref-lookup

Conversation

@willosborne
Copy link
Copy Markdown
Member

Addresses #139 partially.
Now when a node, relationship or interface references a schema with $ref, it will be resolved and generated against a set of schemas loaded with a -s property.
Note this property is optional. For now it just skips lookups if this is not set - eventually will use the bundled metaschema.

Circular references are handled by simply terminating and returning the object as it is so far.

This does not instantiate refs from within nodes - e.g. if you define an object in your defs and simply reference it from a property this won't be followed. It's only definitions of nodes, interfaces and relationships. This will be added in a subsequent PR.

Comment thread cli/src/index.ts
Comment thread cli/src/commands/generate/schema-directory.ts Outdated
Comment thread cli/src/commands/generate/schema-directory.ts
@willosborne willosborne force-pushed the generate-ref-lookup branch from 9e39849 to 0f3c2f1 Compare April 24, 2024 15:48
Comment thread cli/src/commands/generate/schema-directory.ts Outdated
Comment thread cli/src/commands/generate/schema-directory.spec.ts Outdated
lbulanti-ms
lbulanti-ms previously approved these changes Apr 26, 2024
Comment thread cli/src/commands/generate/components/node.ts
Comment thread cli/src/commands/generate/components/node.ts
Comment thread cli/src/commands/generate/components/node.ts
Comment thread cli/src/commands/generate/components/property.ts
Comment thread cli/src/commands/generate/schema-directory.ts Outdated
Comment thread cli/src/commands/generate/schema-directory.ts Outdated
@rocketstack-matt
Copy link
Copy Markdown
Member

@TheJuanAndOnly99 Semgrep action appears to be working on schedule but still failing to login on PR . . . is this just a limitation and something that can't be done (because PR action triggered from fork can't have access to secrets) or is there a project where this is working?

Copy link
Copy Markdown
Member

@aidanm3341 aidanm3341 left a comment

Choose a reason for hiding this comment

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

Will and I agreed to take some time later to try and improve the typing, but that we can still merge this PR in its current state. I'm happy with the changes

@willosborne willosborne merged commit b2b4362 into finos:main Apr 29, 2024
jpgough-ms pushed a commit that referenced this pull request May 6, 2026
…ide (#2422)

The serialize-javascript ^7.0.5 override in package.json wasn't being
applied to mocha's nested copy because the lockfile retained a stale
node_modules/mocha/node_modules/serialize-javascript@6.0.2 entry from
before the override was added. npm install preserves existing nested
entries even when an override is added afterwards.

Removing the stale lockfile entry lets npm re-resolve mocha's
serialize-javascript dependency under the override; it now points at
the hoisted top-level serialize-javascript@7.0.5.

Resolves Dependabot alert #174 (GHSA-5c6j-r48x-rmvq, RCE in
serialize-javascript via RegExp.flags / Date.prototype.toISOString).
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