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

Build tool's plugin options #120

Open
andreaTP opened this issue Jan 4, 2023 · 5 comments
Open

Build tool's plugin options #120

andreaTP opened this issue Jan 4, 2023 · 5 comments
Labels
enhancement New feature or request java Pull requests that update Java code
Milestone

Comments

@andreaTP
Copy link
Contributor

andreaTP commented Jan 4, 2023

There are several reasoning to be done around "how we expect" users to use Kiota in their projects, among others:

  • generate sources and commit the generated result
  • have some sort of script to automate the code generation

Personally, I do like the approach that considers a codegen tool 100% idempotent and the generated code should be reproducible and not committed in the versioning system (i.e. regenerated all the time, build tools are good at caching the results on dev machines).

Following this(opinionated) philosophy I started automating the code generation wrapping the kiota CLI in a Maven plugin:
https://github.com/andreaTP/kiota-utils/blob/main/plugin/src/main/java/io/apicurio/kiota/KiotaMojo.java

Here I'm asking if you have already considered this aspect and what your take on the subject is.
More specifically, would you accept Maven/Gradle plugins in this repo or you prefer them to be third-party?

@baywet baywet self-assigned this Jan 4, 2023
@baywet baywet added the enhancement New feature or request label Jan 4, 2023
@baywet
Copy link
Member

baywet commented Jan 4, 2023

Hi @andreaTP
Thanks for sharing this idea.
This is something we've considered on our roadmap with no hard plans at the moment.
There are multiple experiences we've identified could be integrating with kiota, maven/gradle was not on the following list:

  • internal and external tooling/products at Microsoft (this part is under NDA, I'd be happy to share more on a call but can't share things publicly here at the moment)
  • visual studio (full version)
  • visual studio code (via an extension)
  • https://app.kiota.dev (experimental as this point, but fully runs in the browser)
  • npm/tsc/webpack

A maven/gradle integration sounds like a great idea!
From glancing at the code, I wasn't able to tell how this would be configured in the target projects, especially in the context of generating against multiple APIs in the same project?

As per hosting and publishing it from here, let me share that with my PM and architect and get back to you.

@andreaTP
Copy link
Contributor Author

andreaTP commented Jan 5, 2023

I wasn't able to tell how this would be configured in the target projects, especially in the context of generating against multiple APIs in the same project?

An example project is in the integration test: https://github.com/andreaTP/kiota-utils/tree/main/plugin-it/src/it/basic-codegen-test
and this is the relevant configuration: https://github.com/andreaTP/kiota-utils/blob/1a7dcecd92ce8794fe479e9c37c71d5733a39ff6/plugin-it/src/it/basic-codegen-test/pom.xml#L60-L72

The target API is only one at the moment but is trivial to change it to be an Array.

As per hosting and publishing it from here, let me share that with my PM and architect and get back to you.

Thanks a ton! But, please, consider that depending on the result of #121 it might become more appealing to me to keep more control over the build tool extension.

@baywet
Copy link
Member

baywet commented Jan 5, 2023

Noted.

As per the configuration, yes I think we should design it in such a way that it supports multiple APIs. Or even multiple times the same API but with different filters. That's how we demo kiota and we believe it could change the API consumption paradigm.

@github-project-automation github-project-automation bot moved this to Todo in Kiota Jan 19, 2024
@sebastienlevert sebastienlevert added the java Pull requests that update Java code label Jan 19, 2024
@sebastienlevert sebastienlevert added this to the Backlog milestone Jan 25, 2024
@Sineaggi
Copy link

Sineaggi commented Feb 1, 2024

Could it make sense to add support for kiota-java to https://github.com/OpenAPITools/openapi-generator to, considering it already has maven/gradle plugins available?
Not sure how shareable templates are between kiota and the upstream openapi generator but potentially having templates available in both would be too much of a maintenance burden.

@andreaTP
Copy link
Contributor Author

andreaTP commented Feb 1, 2024

Could it make sense to add support for kiota-java to https://github.com/OpenAPITools/openapi-generator to, considering it already has maven/gradle plugins available?

There is no possible reuse across the two projects as the technological stack and the integration with Java projects are extremely different.

Though there is Ia Maven plugin and a Quarkus extension.

@baywet baywet removed their assignment Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request java Pull requests that update Java code
Projects
Status: New📃
Development

No branches or pull requests

4 participants