Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Merge directive #9

Open
wants to merge 10 commits into
base: oas4_raml2
Choose a base branch
from

Conversation

petrochenko-pavel-a
Copy link

No description provided.


##### Restrictions on macro parameters

Only strings, booleans and numbers are allowed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually a requirement.

@@ -3364,6 +3444,107 @@ Two examples of this:
1. The [Paths Object](#pathsObject) MAY be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#infoObject) which may contain additional information regarding authentication.
2. The [Path Item Object](#pathItemObject) MAY be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#pathsObject), so the user will not be aware of its existence. This allows the documentation provider to finely control what the viewer can see.

### Merge directives

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of dealing with templates breaks schema. But as for me viewing templates as a macros that should be expanded by preprocessor is probably simplest possible option.

1. take a macro definition referenced in `$ref` property and perform template substitution as defined later
2. merge result of template substitution with a base object containing `$merge`key as defined in [Overlays/Extensions](https://github.com/mulesoft-labs/OpenAPI-Specification/pull/3/files#diff-d1455f6edb807e38d88298c2361ec1e3R3644)

If value of `$merge` is an array perform merge operation for each of array members. (Every array member should be an object and must have a valid $ref and $arguments properties)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference resolution should be performed one more time after merge :-(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant