Generator removes the already existing old versions content

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
openapi, typescript

Research direction

Start by reproducing the issue with both the AsyncAPI and OpenAPI generators for Service A, then inspect the generated latest and versioned folders shown in the screenshots. Done means generating version 2 with OpenAPI preserves the existing version 1 content instead of removing it, while still updating the intended service version.

Written by the indexing model from the issue text.

Description

generator-asyncapi
I tried this:

Using both asyncapi and openapi generators leads to unintentional behaviors
Using asyncapi generator generates the version 1 and 2 of service "Service A"
Using openapi generator for only version 2 of same service "Service A"

This happened:

The Asyncapi generator generates both service versions , Version 2 as latest and version 1 as versioned
When openapi generator executed it removes all contents of service A v1.0.0 except the specfile

I expected this:

The generator must detect the corresponding version and extend it without touching the other versions being the latest or previous ones.

Is there a workaround?

Check if the exact version exists and verify if its newer than latest or not
Add a new api method in SDk to allow adding service as a versioned one directly and if version is
The generator will create a version in versioned folder if the current service version is lower than latest
Screenshot 2024-10-20 at 00 36 53

Anything else?

TWO SCREENSHOTS RPRESENTING THE PROBLEM

During OpenApi generation
Screenshot 2024-10-20 at 17 06 06

After openapi spec generation ends with success
Screenshot 2024-10-20 at 17 06 31

EventCatalog Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes
  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
Dominant language
TypeScript
Stars
16
Forks
15
Avg merge
3m
Merged PRs (30d)
7

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from event-catalog/generators

All issues in event-catalog/generators

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.