-
Notifications
You must be signed in to change notification settings - Fork 281
Description
Feature description:
Currently, DevX API has been encountering performance bottlenecks within the API's capacity as a result of growth of Graph resources and the size of the OpenAPI file over time. In a bid to optimize performance and memory usage while adding support for different sovereign clouds, a new proposal targeting layering of OpenAPI documents was born.
Using this layering approach should also help optimize external reference resolution.
Possible solution:
Using a layering approach when dealing with different versions of OpenAPI documents e.g. v1-fairfax.yaml and beta-fairfax.yaml
To layer two OpenAPI documents, you can merge the content of both documents into a single OpenAPI document.
Example:
- First document (petStore1.yaml)
openapi: 3.0.0
info:
title: Document 1
version: 1.0.0
paths:
/pets:
get:
summary: Get all pets
responses:
200:
description: Success- Second document (petStore2.yaml)
openapi: 3.0.0
info:
title: Document 2
version: 1.0.0
paths:
/pets/{id}:
get:
summary: Get a pet's details
responses:
200:
description: Success- Combined document
openapi: 3.0.0
info:
title: Combined Document
version: 1.0.0
paths:
/pets:
get:
summary: Get all pets
responses:
200:
description: Success
/pets/{id}:
get:
summary: Get a pet's details
responses:
200:
description: SuccessAdditional Context:
There are two possible approaches we're considering:
- Using a collection that dedupes objects and shares memory between document object model graphs. We will however need to handle conflicts that may occur when both documents define the same elements (e.g., the same paths or properties) by removing the duplicate elements appearing in both documents. E.g.:
// merge 2 documents
petStore1.Attach(petStore2);
// Get DOM of the merged documents
var mergedInfo = petStore1.Info;- Adding a layer property to the object models which in memory will be represented as a collection e.g. a dictionary of type
<string, OpenAPIElement>which can help us index into a particular document and its properties e.g.
// Get DOM of a specific layer
var petStore1Info = petStore1.Layer["petStore1"].Info;
var petStore2Info = petStore1.Layer["petStore2"].Info;Cc: @baywet, @darrelmiller