You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix documentation of additionalProperties field when used with array parameters (#840)
* Fix typo in CHANGELOG
* Allow usage of additional_properties, deprecate additionalProperties
All other options are snake-cased rather than camel-cased, so this keeps things consistent.
* Ignore .byebug_history
* Add test covering additional_properties
* Fix additionalProperties for arrays of objects
* Fix settings additional_properties to false
* Handle receiving types and entities in additional_properties
This includes a fix to MoveParams.document_as_property for an issue found while testing these changes.
* Refactor to use Enumerable#any?
* Document additional_properties
* Update CHANGELOG
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,9 @@
6
6
7
7
#### Fixes
8
8
9
+
*[#840](https://github.com/ruby-grape/grape-swagger/pull/840): Fixes documentation of `additionalProperties` field when used with array parameters, or when setting it to `false` - [@magni-](https://github.com/magni-)
9
10
*[#841](https://github.com/ruby-grape/grape-swagger/pull/839): Fixes `type` and `format` values for object fields nested in an array ([#832](https://github.com/ruby-grape/grape-swagger/issue/832)) - [@magni-](https://github.com/magni-)
10
-
*#[#839](https://github.com/ruby-grape/grape-swagger/pull/839): Fixes documentation of `false` or `nil` default parameter values - [@magni-](https://github.com/magni-)
11
+
*[#839](https://github.com/ruby-grape/grape-swagger/pull/839): Fixes documentation of `false` or `nil` default parameter values - [@magni-](https://github.com/magni-)
Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -451,6 +451,7 @@ add_swagger_documentation \
451
451
*[Collection Format](#collection-format)
452
452
*[Hiding parameters](#hiding-parameters)
453
453
*[Setting a Swagger default value](#default-value)
454
+
*[Setting `additionalProperties` for `object`-type parameters](#additional-properties)
454
455
*[Example parameter value](#param-example)
455
456
*[Response documentation](#response)
456
457
*[Changing default status codes](#change-status)
@@ -779,6 +780,36 @@ params do
779
780
end
780
781
```
781
782
783
+
### Setting `additionalProperties` for `object`-type parameters <aname="additional-properties">
784
+
785
+
Use the `additional_properties` option in the `documentation` hash for `object`-type parameters to set [`additionalProperties`](https://swagger.io/specification/v2/#model-with-mapdictionary-properties).
Copy file name to clipboardExpand all lines: UPGRADING.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
## Upgrading Grape-swagger
2
2
3
+
### Upgrading to >= 1.4.1
4
+
5
+
-`additionalProperties` has been deprecated and will be removed in a future version of `grape-swagger`. It has been replaced with `additional_properties`.
6
+
3
7
### Upgrading to >= 1.4.0
4
8
5
9
- Official support for ruby < 2.5 removed, ruby 2.5 only in testing mode, but no support.
0 commit comments