forked from cebe/php-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDocumentContextInterface.php
More file actions
40 lines (35 loc) · 1.46 KB
/
DocumentContextInterface.php
File metadata and controls
40 lines (35 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @copyright Copyright (c) 2018 Carsten Brandt <mail@cebe.cc> and contributors
* @license https://github.com/cebe/php-openapi/blob/master/LICENSE
*/
namespace cebe\openapi;
use cebe\openapi\json\JsonPointer;
/**
* Interface implemented by OpenAPI objects that provide functionality for context in the document.
*
* Allows an object to reference the base OpenAPI document as well as its own position inside of
* the document in form of a [JSON pointer](https://tools.ietf.org/html/rfc6901).
*/
interface DocumentContextInterface
{
/**
* Provide context information to the object.
*
* Context information contains a reference to the base object where it is contained in
* as well as a JSON pointer to its position.
* @param SpecObjectInterface $baseDocument
* @param JsonPointer $jsonPointer
*/
public function setDocumentContext(SpecObjectInterface $baseDocument, JsonPointer $jsonPointer);
/**
* @return SpecObjectInterface|null returns the base document where this object is located in.
* Returns `null` if no context information was provided by [[setDocumentContext]].
*/
public function getBaseDocument(): ?SpecObjectInterface;
/**
* @return JsonPointer|null returns a JSON pointer describing the position of this object in the base document.
* Returns `null` if no context information was provided by [[setDocumentContext]].
*/
public function getDocumentPosition(): ?JsonPointer;
}