-
Notifications
You must be signed in to change notification settings - Fork 18
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 reference related metadata to namespaces #538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the purpose of this PR was to provide complete referencing metadata support via metadata, then we're still missing some objects that can support referenceing
This is for openapi:
const canHaveReference = (element) => {
return (
isReferenceElement(element) ||
(isSchemaElement(element) && isStringElemenet(element.$ref)) ||
(isExampleElement(element) && isStringElement(element.externalValue)) ||
(isPathItemElement(element) && isStringElement(elemenet.$ref)) ||
(isLinkElement(element) && isStringElement(element.operationRef))
);
};
Asyncapi have Reference Object and Channel Item Object
...ackages/apidom-ns-asyncapi-2-0/src/refractor/visitors/async-api-2-0/reference/$RefVisitor.ts
Outdated
Show resolved
Hide resolved
methods: { | ||
StringElement(stringElement: StringElement) { | ||
this.element = stringElement.clone(); | ||
this.element.classes.push('reference-field'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: naming
apidom/packages/apidom-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/schema/$refVisitor.ts
Outdated
Show resolved
Hide resolved
// get current $ref keyword | ||
const $ref = objectElement.get('$ref')?.toValue(); | ||
|
||
// if it's a non empty strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: would drop the comment here; it doesn't express anything else then the following declarative assertion
No description provided.