Skip to content

Commit 6f78824

Browse files
committed
adding setters
1 parent 5a38f70 commit 6f78824

27 files changed

+2944
-63
lines changed

src/JsonSchema.php

Lines changed: 404 additions & 63 deletions
Large diffs are not rendered by default.

src/SwaggerSchema/ApiKeySecurity.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,45 @@ public static function setUpProperties($properties, JsonBasicSchema $ownerSchema
5151
2 => 'in',
5252
);
5353
}
54+
55+
/**
56+
* @param string $type
57+
* @return $this
58+
*/
59+
public function setType($type)
60+
{
61+
$this->type = $type;
62+
return $this;
63+
}
64+
65+
/**
66+
* @param string $name
67+
* @return $this
68+
*/
69+
public function setName($name)
70+
{
71+
$this->name = $name;
72+
return $this;
73+
}
74+
75+
/**
76+
* @param string $in
77+
* @return $this
78+
*/
79+
public function setIn($in)
80+
{
81+
$this->in = $in;
82+
return $this;
83+
}
84+
85+
/**
86+
* @param string $description
87+
* @return $this
88+
*/
89+
public function setDescription($description)
90+
{
91+
$this->description = $description;
92+
return $this;
93+
}
5494
}
5595

src/SwaggerSchema/BasicAuthenticationSecurity.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,25 @@ public static function setUpProperties($properties, JsonBasicSchema $ownerSchema
3737
0 => 'type',
3838
);
3939
}
40+
41+
/**
42+
* @param string $type
43+
* @return $this
44+
*/
45+
public function setType($type)
46+
{
47+
$this->type = $type;
48+
return $this;
49+
}
50+
51+
/**
52+
* @param string $description
53+
* @return $this
54+
*/
55+
public function setDescription($description)
56+
{
57+
$this->description = $description;
58+
return $this;
59+
}
4060
}
4161

src/SwaggerSchema/BodyParameter.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,55 @@ public static function setUpProperties($properties, JsonBasicSchema $ownerSchema
5656
2 => 'schema',
5757
);
5858
}
59+
60+
/**
61+
* @param string $description A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
62+
* @return $this
63+
*/
64+
public function setDescription($description)
65+
{
66+
$this->description = $description;
67+
return $this;
68+
}
69+
70+
/**
71+
* @param string $name The name of the parameter.
72+
* @return $this
73+
*/
74+
public function setName($name)
75+
{
76+
$this->name = $name;
77+
return $this;
78+
}
79+
80+
/**
81+
* @param string $in Determines the location of the parameter.
82+
* @return $this
83+
*/
84+
public function setIn($in)
85+
{
86+
$this->in = $in;
87+
return $this;
88+
}
89+
90+
/**
91+
* @param bool $required Determines whether or not this parameter is required or optional.
92+
* @return $this
93+
*/
94+
public function setRequired($required)
95+
{
96+
$this->required = $required;
97+
return $this;
98+
}
99+
100+
/**
101+
* @param Schema $schema A deterministic version of a JSON Schema object.
102+
* @return $this
103+
*/
104+
public function setSchema($schema)
105+
{
106+
$this->schema = $schema;
107+
return $this;
108+
}
59109
}
60110

src/SwaggerSchema/Contact.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,35 @@ public static function setUpProperties($properties, JsonBasicSchema $ownerSchema
4141
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.';
4242
$ownerSchema->description = 'Contact information for the owners of the API.';
4343
}
44+
45+
/**
46+
* @param string $name The identifying name of the contact person/organization.
47+
* @return $this
48+
*/
49+
public function setName($name)
50+
{
51+
$this->name = $name;
52+
return $this;
53+
}
54+
55+
/**
56+
* @param string $url The URL pointing to the contact information.
57+
* @return $this
58+
*/
59+
public function setUrl($url)
60+
{
61+
$this->url = $url;
62+
return $this;
63+
}
64+
65+
/**
66+
* @param string $email The email address of the contact person/organization.
67+
* @return $this
68+
*/
69+
public function setEmail($email)
70+
{
71+
$this->email = $email;
72+
return $this;
73+
}
4474
}
4575

src/SwaggerSchema/ExternalDocs.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,25 @@ public static function setUpProperties($properties, JsonBasicSchema $ownerSchema
3636
0 => 'url',
3737
);
3838
}
39+
40+
/**
41+
* @param string $description
42+
* @return $this
43+
*/
44+
public function setDescription($description)
45+
{
46+
$this->description = $description;
47+
return $this;
48+
}
49+
50+
/**
51+
* @param string $url
52+
* @return $this
53+
*/
54+
public function setUrl($url)
55+
{
56+
$this->url = $url;
57+
return $this;
58+
}
3959
}
4060

src/SwaggerSchema/FileSchema.php

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,95 @@ public static function setUpProperties($properties, JsonBasicSchema $ownerSchema
6868
0 => 'type',
6969
);
7070
}
71+
72+
/**
73+
* @param string $format
74+
* @return $this
75+
*/
76+
public function setFormat($format)
77+
{
78+
$this->format = $format;
79+
return $this;
80+
}
81+
82+
/**
83+
* @param string $title
84+
* @return $this
85+
*/
86+
public function setTitle($title)
87+
{
88+
$this->title = $title;
89+
return $this;
90+
}
91+
92+
/**
93+
* @param string $description
94+
* @return $this
95+
*/
96+
public function setDescription($description)
97+
{
98+
$this->description = $description;
99+
return $this;
100+
}
101+
102+
/**
103+
* @param $default
104+
* @return $this
105+
*/
106+
public function setDefault($default)
107+
{
108+
$this->default = $default;
109+
return $this;
110+
}
111+
112+
/**
113+
* @param string[]|array $required
114+
* @return $this
115+
*/
116+
public function setRequired($required)
117+
{
118+
$this->required = $required;
119+
return $this;
120+
}
121+
122+
/**
123+
* @param string $type
124+
* @return $this
125+
*/
126+
public function setType($type)
127+
{
128+
$this->type = $type;
129+
return $this;
130+
}
131+
132+
/**
133+
* @param bool $readOnly
134+
* @return $this
135+
*/
136+
public function setReadOnly($readOnly)
137+
{
138+
$this->readOnly = $readOnly;
139+
return $this;
140+
}
141+
142+
/**
143+
* @param ExternalDocs $externalDocs information about external documentation
144+
* @return $this
145+
*/
146+
public function setExternalDocs($externalDocs)
147+
{
148+
$this->externalDocs = $externalDocs;
149+
return $this;
150+
}
151+
152+
/**
153+
* @param $example
154+
* @return $this
155+
*/
156+
public function setExample($example)
157+
{
158+
$this->example = $example;
159+
return $this;
160+
}
71161
}
72162

0 commit comments

Comments
 (0)