event-catalog / eventcatalog

An open source documentation tool to bring discoverability to your event-driven architectures
https://eventcatalog.dev
MIT License
1.78k stars 151 forks source link

OpenAPI/AsyncAPI from remote URL #378

Closed thawankeane closed 1 year ago

thawankeane commented 1 year ago

Have you read the Contributing Guidelines on issues?

Description

Currently, the only way to add a service OpenAPI (AyncAPI also) is to add the spec file into the service directory, but doing this can be painful to keep it up sync between the projects.

It will be nice if we could configure one or more spec URLs inside the service frontmatter configuration alternatively to the physical files.

This is my proposal (if it's possible):

---
name: PetstoreService
summary: |
  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae in ex quaerat cum nihil expedita recusandae non, dolores corporis corrupti odio reprehenderit repellat possimus aliquid vero exercitationem!
owners:
  - johndoe
openapi:
  - https://petstore3.swagger.io/api/v3/openapi.json
---

Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur unde adipisci vel. Perferendis, inventore quas maxime a dolores consequatur soluta iste nisi, exercitationem beatae quidem ad. Velit voluptatem veniam libero.

<OpenAPI />

<NodeGraph />

Motivation

Many times, OpenAPI/AsyncAPI specifications are hosted into remote URLs, it easier to keep everything synced. Currently, to make eventcatalog updated with those remote URLs, developers (or CI scripts) must download these files from the remote and put them in each service directory.

boyney123 commented 1 year ago

Hey @thawankeane

Just released this one https://github.com/boyney123/eventcatalog/issues/387

You should be able to pass any probs to this component now, I believe if you pass the url prop to the component with the url of the file it will work.

Closing this issue for now, I tested locally and worked :)