Commit Graph

22 Commits

Author SHA1 Message Date
Andrei Subbota e2b50b347a
Force request body to be an schema object (#922)
* Force request body to be an schema object

* Require "OpenStruct" explicitly in specs

* Update changelog and upgrading documentation
2024-04-22 05:50:05 +02:00
Paul Padier 1a3e3f5889
Allow using nicknames for body definitions (#862)
* Fix typo

* Refactor MoveParams.parent_definition_of_params to use OperationId.build rather than OperationId.manipulate

This means it'll use route nicknames if those are available. It also means route parameters will be used in the definition names.

* Simplify MoveParams.build_body_parameter

MoveParams.build_definition returns the passed in name, so name and referenced_definition were always the same value.

* Fix Rubocop offenses

* Fix old reference to Travis CI in CONTRIBUTING

* Fix CHANGELOG

* Update CHANGELOG and UPGRADING
2022-07-26 09:44:42 +02:00
Masayoshi Takahashi eb94a3181e
Fix value of enum to be Array (#850) 2022-03-06 15:41:11 +01:00
peter scholz 8a5daa8605
Prepare release 1.4.2 (#842) 2021-10-22 07:48:13 +02:00
Paul Padier 1fea1f8d19
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
2021-10-21 21:43:06 +02:00
peter scholz ac09d8c0c6
Adds upgrade notice. (#819) 2021-03-15 23:30:45 +01:00
Jean-Francis Bastien 565f8e9a29
Don't overwrite model description with the route destription. (#804) 2020-09-03 22:43:49 +02:00
Edward Rudd 3cb37fe9f3
Allow entity_name to be called on parent classes (#794)
This resolves issue #659.
2020-07-01 21:00:30 +02:00
Garrett Blehm 961e7ca927
Modify full entity name to be RFC3986 compliant #797 (#798)
* Modify full entity name to be RFC3986 compliant #797

Signed-off-by: Garrett Blehm <garrett.blehm@cerner.com>

* Update changelog and upgrading files

Signed-off-by: Garrett Blehm <garrett.blehm@cerner.com>

* Update Changelog

* Corrects next version

* Modified ineritance and discriminator spec

Signed-off-by: Garrett Blehm <garrett.blehm@cerner.com>

Co-authored-by: Garrett Blehm <garrett.blehm@cerner.com>
Co-authored-by: peter scholz <pscholz.le@gmail.com>
2020-06-30 16:20:34 +02:00
Valentine Kiselev 8f978dc8d2
Use full entity name as a default (fixes #779) (#786)
* Use full entity name as a default (fixes #779)

I just wanted to resolve this:

```
- model.to_s.split('::').last
+ model.to_s
```

But I met a problem that it receives Class type in here
8abddd5f2c/lib/grape-swagger/endpoint.rb (L354)
But String type in the another place, where the type is generated. So,
splitting and taking the last actually returns the same as `name`
method of the class. That is very strange I think.

Also, if we, for example, use such constructions, we end up with just
`V1` and `V2` fron the `A::B` module as they are parsed first:

```ruby
module A
  module B
    class V1 < Grape::Entity
     ...

    class V2 < Grape::Entity
     ...

module A
  module C
    class V1 < Grape::Entity
      ...

    class V2 < Grape::Entity
      ...
```

This PR fixes this issue.

* Update CHANGELOG

* Fix for old Ruby versions

* Skip Representable:: prefix just like Entity::

* Add upgrade entry and move changelog entry from fixes to features scope
2020-04-20 10:58:37 +02:00
peter scholz e5afd7db08 allows custom format (#576)
- adds spec for default value
- adds changelog entry
- updates UPGRADING
2017-02-03 17:35:34 +01:00
peter scholz 51d4ff6622 issue#566: removes markdown (#567)
- updates README
- updates UPGRADING
- adds changelog entry
- cleans up gemfile
2017-01-14 16:49:51 +01:00
peter scholz f6d9ad6bd1 updates travis.yml (#554)
- updates UPGRADE
- adds changelog entry
2016-12-18 02:27:22 +01:00
peter scholz 7d405ff714 use route tags for global tag set (#524)
* minor adoptions on README

* build global tag set from route tags
- adds changelog entry
- adds note in UPGRADING
2016-10-23 19:45:33 +02:00
peter scholz 64908af40a makes version settings more clear (#489)
- updates UPGRADES.md
- adds CHANGELOG entry
2016-08-02 01:37:45 +02:00
Kirill Zaitsev f4a0c15687 Move model parsing logic outside grape-swagger 2016-05-10 21:59:15 +03:00
dblock a91d069d07 Moved to the ruby-grape organization. 2015-08-19 12:12:41 -04:00
Tobias Bielohlawek 7b9955ea2b Use `detail` option as `notes` value.
This adds support for using the `detail` value defined within a block passed to `desc` as `notes` value exposed in swagger doc.

CAUTION: only works on grape version > 0.10.0
```
$ GRAPE_VERSION=HEAD bundle exec rspec ./spec/default_api_spec.rb:62
```

fixes #212
2015-08-19 10:01:58 +02:00
dblock 6a7b71d3ed Added a note on upgrading to Grape 0.10.0 with format: :json. 2015-03-11 10:17:31 -04:00
Daniel Doubrovkine (dB.) @dblockdotorg 4a49da2e19 This only matters with grape-swagger-rails. 2015-01-13 09:06:20 -05:00
Daniel Doubrovkine (dB.) @dblockdotorg 29e9afefaf Added note related to #187. 2015-01-13 09:04:16 -05:00
Antek Drzewiecki 4a79e05af0 Added UPGRADING instructions.
Support instantiating the markdown adapeter without creating an instance.
2014-08-29 12:57:30 -04:00