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

fix: nullish examples #1033

Merged
merged 8 commits into from
Jan 4, 2024

Conversation

Shiva953
Copy link
Contributor

Description

  • This PR addresses the issue related to the async-api CLI build process failing when encountering invalid examples in the spec repository. It filters out the null values from the exampleList.
  • ...

Related issue(s)
Resolves #994

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@Shiva953
Copy link
Contributor Author

@smoya

@@ -86,7 +86,7 @@ const buildCLIListFromExamples = async () => {
}
});

const exampleList = await Promise.all(buildExampleList);
const exampleList = (await Promise.all(buildExampleList)).filter(item => item!==null);
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick:

Suggested change
const exampleList = (await Promise.all(buildExampleList)).filter(item => item!==null);
const exampleList = (await Promise.all(buildExampleList)).filter(item => item !== null);

It seems we are not passing any linter to the scripts under scripts dir (I don't know the reason cc @Souvikns). Anyway this nitpick I suggest improves readability and needs to be considered.

@smoya
Copy link
Member

smoya commented Dec 15, 2023

@Shiva953 could you confirm you have tested this with an examples.json file that includes a null object?

@Shiva953
Copy link
Contributor Author

Shiva953 commented Dec 15, 2023

@Shiva953 could you confirm you have tested this with an examples.json file that includes a null object?

sure, here's the test(however, I also had to made the condition if(!document) to return null; instead of just return;, because seemed like it was returning undefined instead of null before, which led the test to fail before it. Though now, after the change it works fine.

b8db1224d3e14ff69a591967fe891cb2.mp4

@smoya
Copy link
Member

smoya commented Dec 19, 2023

We need a code owner to aprove the workflows to run, also to review this. cc @Souvikns @magicmatatjahu @derberg

@Shiva953
Copy link
Contributor Author

Shiva953 commented Jan 3, 2024

@smoya @Souvikns any changes that need to be made?

Copy link

sonarqubecloud bot commented Jan 4, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

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

See analysis details on SonarCloud

@Souvikns
Copy link
Member

Souvikns commented Jan 4, 2024

/rtm

@asyncapi-bot asyncapi-bot merged commit 718b8e8 into asyncapi:master Jan 4, 2024
10 checks passed
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.2.31 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Shiva953 Shiva953 changed the title fix: nullish examples in examples.json fix: nullish examples Jan 4, 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.

Having invalid examples in spec fails CLI build
4 participants