Skip to content
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 all{components} functions #969

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

KhudaDad414
Copy link
Member

Description

allServerVariables(): ServerVariablesInterface;
allParameters(): ChannelParametersInterface;
allCorrelationIds(): CorrelationIdsInterface;
allTags(): TagsInterface;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
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.


import type { v3 } from '../../spec-types';

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

@smoya smoya Apr 8, 2024

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
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
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.

Copy link

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

Copy link

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

Copy link

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
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