cebe / php-openapi

Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.
MIT License
466 stars 88 forks source link

Add option to inline only external references #63

Closed cebe closed 3 years ago

cebe commented 4 years ago

Currently resolving references resolves all references unless they are recursive.

There should be more options to support cases where only external references should be inlined. See also: https://stoplight.io/blog/keeping-openapi-dry-and-portable/

aedart commented 3 years ago

Is there any way that this can be achieved in the current released version? If so, could you please point in the right direction?

cebe commented 3 years ago

It will be possible with release of version 1.5, on master you can use $resolveReferences parameter of readFromJsonFile() and readFromYamlFile():

https://github.com/cebe/php-openapi/blob/015bd48b0f963e65641a33ce9c333e62d6ad8ee3/src/Reader.php#L64-L66

cebe commented 3 years ago
cebe commented 3 years ago

1.5.0 is going to be released today.