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 file path as input #1601

Merged
merged 10 commits into from
Nov 22, 2023

Conversation

nilkanth987
Copy link
Contributor

@nilkanth987 nilkanth987 commented Nov 13, 2023

Description

  • Added inputProcessor option in the AbstractGenerator with type enum param
  • This option will allow users to pass how to process input to generators
  • Added file option in input type to allow user to pass file path as input to any generator
  • Changed input type in generateToFiles method in AbstractFileGenerator to any for handling any type of input
  • Looking for some input so I can improve the error logging
  • Also need to know what are the different types of inputs so I can add them in InputTypes enum and handle them.
  • NOTE: Documentation update is pending

Related issue(s)
Resolves #1591

Copy link

netlify bot commented Nov 13, 2023

Deploy Preview for modelina canceled.

Name Link
🔨 Latest commit 4531288
🔍 Latest deploy log https://app.netlify.com/sites/modelina/deploys/655e5b55d063ee000859ad2f

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.

@nilkanth987 nilkanth987 changed the base branch from master to next November 13, 2023 09:41
Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to do this @nilkanth987 🙏 Got a few things that are needed to change 🙂

src/generators/AbstractGenerator.ts Outdated Show resolved Hide resolved
src/generators/AbstractGenerator.ts Outdated Show resolved Hide resolved
src/generators/AbstractGenerator.ts Outdated Show resolved Hide resolved
test/generators/testasyncapi.yml Outdated Show resolved Hide resolved
Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

You have some linting issues that make it hard to review the PR 🙂

@nilkanth987
Copy link
Contributor Author

@jonaslagoni , Fixed linting issues. Also do I have to use new Parser for fromFile method? It does not accept the newParser.

@jonaslagoni
Copy link
Member

@jonaslagoni , Fixed linting issues. Also do I have to use new Parser for fromFile method? It does not accept the newParser.

Let me check 🙂

@jonaslagoni
Copy link
Member

@nilkanth987 when you say new parser what do you mean?

@nilkanth987
Copy link
Contributor Author

@jonaslagoni , This is the new parser added in next branch that I was referring to.

import { NewParser } from '@smoya/multi-parser';

@jonaslagoni
Copy link
Member

@nilkanth987 its not a new parser just a bundler that can convert between multiple implementations.

Just keep what you have 👍

1 similar comment
@jonaslagoni
Copy link
Member

@nilkanth987 its not a new parser just a bundler that can convert between multiple implementations.

Just keep what you have 👍

@nilkanth987
Copy link
Contributor Author

@jonaslagoni , If everything looks good then should I write documentation for the changes done in PR?

@jonaslagoni
Copy link
Member

@jonaslagoni , If everything looks good then should I write documentation for the changes done in PR?

Yes, add an example and documentation for the feature 👌

Also make sure you fix the linting problem the CI complains about 🙂

@nilkanth987
Copy link
Contributor Author

@jonaslagoni , Added example. Let me know if any issue. Merge it if everything looks good. 🙂

@jonaslagoni
Copy link
Member

@nilkanth987
Copy link
Contributor Author

@jonaslagoni , Fixed

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Nice persistence @nilkanth987! 🔥

@jonaslagoni
Copy link
Member

/rtm

@jonaslagoni jonaslagoni changed the title feat: added file path as input feat: add file path as input Nov 22, 2023
@jonaslagoni jonaslagoni merged commit 268bfd4 into asyncapi:next Nov 22, 2023
24 of 27 checks passed
@jonaslagoni
Copy link
Member

@all-contributors please add @nilkanth987 for code, test, example, docs

Copy link
Contributor

@jonaslagoni

I've put up a pull request to add @nilkanth987! 🎉

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 3.0.0-next.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jonaslagoni jonaslagoni mentioned this pull request Nov 23, 2023
jonaslagoni added a commit that referenced this pull request Feb 1, 2024
* feat!: convert to use multi parser (#1587)
* feat!: adds support for duration in java (#1604)
* feat: enable AsyncAPI v3 (#1600)
* fix!: add csharp support for DateTime, TimeSpan, Guid (#1612)
* feat!: adds extend in common, meta, and constrained models (#1613)
* feat!: adds inheritance with interfaces for java (#1593)
* chore: remove duplicate version entry for AsyncAPI processor (#1609)
* feat!: render python union in pydantic in the pre 3.10 way (#1626)
* feat: add file path as input (#1601)
* feat!: add options as parameter to constraints (#1667)
* fix: (un)marshalling tuple and dictionary unwrapping for Typescript (#1717)
* fix: jsonbinpack preset and runtime tests (#1718)
* chore: fix linting
* chore: remove unused directory
* feat!: add useJavascriptReservedKeywords option for TS (#1727)
* feat: enable raw properties for interface (#1729)
* fix: newtonsoft could not handle enum values (#1731)
* chore: update Java runtime tests (#1739)
* fix: edge case where references was incorrect handled for JSON Schema (#1754)
* fix: recursion bug for get nearest dependencies (#1757)

---------

Co-authored-by: Kenneth Aasan <k.aasan@sportradar.com>
Co-authored-by: jano-petras <jano.petras@gmail.com>
Co-authored-by: Nilkanth Parmar <parmarnilkanth@gmail.com>
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 4.0.0-next.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File path as input to the generator
5 participants