OAI / OpenAPI-Specification

The OpenAPI Specification Repository
https://openapis.org
Apache License 2.0
28.91k stars 9.07k forks source link

This looks to me like a very useful feature, and i'm not sure why it was closed. Is it abandoned ? #2853

Closed MaxenceMaire closed 2 years ago

MaxenceMaire commented 2 years ago

This looks to me like a very useful feature, and i'm not sure why it was closed. Is it abandoned ?

Anyway, allow me to expose a legitimate usecase that only this nesting feature would fulfill (as fas as I understand): service composition. I'd happy to know if there's another way to implement it.

Let's say we have two independent services, A and B, each coming with their respective service descriptions serviceA.yaml, serviceB.yaml embedded at their roots. These services can potentially be deployed as standalone applications, on arbitrary URL subpaths, e.g. http://foo.com/serviceA, with its description then sitting at http://foo.com/serviceA/serviceA.yaml and looking like

servers:
  - description: Service A
    url: .
paths:
    ...

Then there's a need to deploy a service C, that composes A and B under two subpaths : http://foo.com/serviceC/serviceA and http://foo.com/serviceC/serviceB. It should be possible to declare this composition in http://foo.com/serviceC/serviceC.yaml, containing something like :

servers:
  - description: Composed Service C
    url: .
paths:
  /serviceA:
    $ref: 'serviceA/serviceA.yaml'
  /serviceB:
    $ref: 'serviceB/serviceB.yaml'

Can you comment on this usecase ?

Originally posted by @pduchesne in https://github.com/OAI/OpenAPI-Specification/issues/647#issuecomment-444612891

heyline commented 5 months ago

I have the same needs, do you have any ideas how to achieve it?

handrews commented 5 months ago

@heyline for things related to this that we're considering for 4.0 see: