Code Monkey home page Code Monkey logo

Comments (3)

nscuro avatar nscuro commented on May 28, 2024

Some additional notes:

  1. OpenRewrite has a recipe for the migration to Jakarta EE 9: https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxmigrationtojakarta. I tested it already and it works great, both for the Alpine and Dependency-Track codebase.
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:LATEST \
  -Drewrite.activeRecipes=org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta
  1. swagger-core 1.x does not support Jakarta. We have to upgrade to 2.x, which also changes the OpenAPI spec from 2.x to 3.x. This means we have an implicit dependency on #1. Lots of annotations have changed, causing increased manual refactoring effort, especially on the Dependency-Track side.

from alpine.

nscuro avatar nscuro commented on May 28, 2024

@stevespringett What is your current opinion on how to deal with Alpine's OpenAPI integration?

  • As mentioned above, updating the Swagger library is a precondition for moving forward with the Jakarta migration
    • Updating swagger-core will cause significant refactoring efforts in DT due to all the annotation changes
  • DependencyTrack/dependency-track#840 states that auto-generated OpenAPI docs should be removed altogether from Alpine and DT, and switching to manually-maintained OpenAPI docs instead

Should we upgrade swagger-core, or should we drop it completely from Alpine?

I propose to:

  1. Remove Swagger / OpenAPI from Alpine entirely (would this require a Alpine v3 release?)
  2. Export the current auto-generated Swagger doc from DT
  3. Remove all Swagger annotations from DT
  4. Serve exported swagger.json in DT via static file servlet

In a next step, we can start working on DependencyTrack/dependency-track#840:

  • As this will be a larger task, we can ship the new OpenAPI v3 manifest in addition to the legacy Swagger v2 file
    • e.g. /api/swagger.json and /api/openapi-v3.yaml
  • OpenAPI v3 manifest will be worked on iteratively until it covers the entire API surface
  • Once coverage reaches 100%, remove legacy swagger.json

Thoughts?

from alpine.

stevespringett avatar stevespringett commented on May 28, 2024

That sounds like a solid approach. We will eventually need to determine, possibly through a PR check, of modifications made to a resource which do not include modifications to the api docs. Keeping the api docs in sync with the code may be a challenge, but at least we'll have accurate docs at some point.

Alpine v3 sounds good to me.

from alpine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.