Skip to content

feat: add all{components} functions - #969

Closed
KhudaDad414 wants to merge 5 commits into
asyncapi:masterfrom
KhudaDad414:add-allComponent-functions
Closed

KhudaDad414 wants to merge 5 commits into
asyncapi:masterfrom
KhudaDad414:add-allComponent-functions

Conversation

@KhudaDad414

Copy link
Copy Markdown
Member

Description

Comment thread src/models/asyncapi.ts
allServerVariables(): ServerVariablesInterface;
allParameters(): ChannelParametersInterface;
allCorrelationIds(): CorrelationIdsInterface;
allTags(): TagsInterface;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@smoya I'm a little confused about where to add the allReplies function. If I add it here, then v2 also needs to implement it. But v2 doesn't have replies. I see three possible approaches:

  1. Remove allReplies from parser-api since it can't be implemented for v2.
  2. Add it here and return an empty array for the v2 implementation.
  3. Add allReplies to v3 only.

I would appreciate some insight on this.

Comment thread src/models/v3/asyncapi.ts

export class AsyncAPIDocument extends BaseModel<v3.AsyncAPIObject> implements AsyncAPIDocumentInterface {
allSecuritySchemes(): SecuritySchemesInterface {
return this.securitySchemes();

@smoya smoya Apr 8, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see two issues here:

  1. If allSecuritySchemes does the same as securitySchemes, then this is redundant.
  2. I believe securitySchemes method implementation is wrong ATM because it is only returning Security Schemes from components but instead would need to return from, for example, Operations in the root document.

cc @jonaslagoni please double 👀 just in case I'm delirious.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. If allSecuritySchemes does the same as securitySchemes, then this is redundant.

I agree. it has only been added for the sake of completeness.

  1. I believe securitySchemes method implementation is wrong ATM because it is only returning Security Schemes from components but instead would need to return from, for example, Operations in the root document.

the problem is that when I try to access the security scheme of an specific operation or operationTrait it returns SecurityRequirements[] instead of SecuritySchemes.

not sure if this is a bug or I am missing something.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@smoya pingy pongy.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions Bot added the stale label Oct 10, 2024
@github-actions github-actions Bot closed this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants