Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to inline only external references #63

Closed
cebe opened this issue Mar 17, 2020 · 4 comments · Fixed by #67
Closed

Add option to inline only external references #63

cebe opened this issue Mar 17, 2020 · 4 comments · Fixed by #67
Labels
enhancement New feature or request
Milestone

Comments

@cebe
Copy link
Owner

cebe commented Mar 17, 2020

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/

@cebe cebe added the enhancement New feature or request label Mar 17, 2020
@cebe cebe added this to the 1.5.0 milestone Mar 17, 2020
@aedart
Copy link

aedart commented Nov 19, 2020

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 cebe closed this as completed in #67 Dec 14, 2020
@cebe cebe reopened this Dec 14, 2020
@cebe
Copy link
Owner Author

cebe commented Dec 14, 2020

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

* Since version 1.5.0 this can be a string indicating the reference resolving mode:
* - `inline` only resolve references to external files.
* - `all` resolve all references exceot recursive references.

@cebe
Copy link
Owner Author

cebe commented Dec 14, 2020

  • should be implemented in the command line tool:

    php-openapi/bin/php-openapi

    Lines 192 to 194 in 34f6e20

    // TODO apply reference context mode
    // $referenceContext->mode = ReferenceContext::RESOLVE_MODE_ALL;
    // $referenceContext->mode = ReferenceContext::RESOLVE_MODE_INLINE;

  • docs need to be added to the README

@cebe cebe closed this as completed in 310de02 Dec 31, 2020
@cebe
Copy link
Owner Author

cebe commented Dec 31, 2020

1.5.0 is going to be released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants