Skip to content

Commit 7396b1b

Browse files
committed
Update docs [ci-skip]
1 parent 9942e12 commit 7396b1b

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

README.md

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ gem 'grape-swagger-entity'
3939
gem 'grape-swagger-representable'
4040
```
4141

42-
##### Custom model parser interface
42+
##### Custom Model Parsers
4343

44-
You can create your own model parser, for example for [roar](https://github.com/apotonick/roar)
44+
You can create your own model parser, for example for [roar](https://github.com/apotonick/roar).
4545

4646
```rb
4747
module GrapeSwagger
@@ -63,35 +63,27 @@ module GrapeSwagger
6363
end
6464
```
6565

66-
Then you should register your custom parser:
66+
Then you should register your custom parser.
6767

6868
```rb
6969
GrapeSwagger.model_parsers.register(GrapeSwagger::Roar::Parser, Roar::Decorator)
7070
```
7171

72-
To controll model parsers sequence, you can insert your Parser before or after another parser
72+
To control model parsers sequence, you can insert your parser before or after another parser.
7373

74-
before:
74+
#### insert_before
7575

7676
```rb
77-
if defined?(GrapeSwagger::Representable::Parser)
78-
GrapeSwagger.model_parsers.insert_before(GrapeSwagger::Representable::Parser, GrapeSwagger::Roar::Parser, Roar::Decorator)
79-
else
80-
GrapeSwagger.model_parsers.register(GrapeSwagger::Roar::Parser, Roar::Decorator)
81-
end
77+
GrapeSwagger.model_parsers.insert_before(GrapeSwagger::Representable::Parser, GrapeSwagger::Roar::Parser, Roar::Decorator)
8278
```
8379

84-
after:
80+
#### insert_after
8581

8682
```rb
87-
if defined?(GrapeSwagger::Roar::Parser)
88-
GrapeSwagger.model_parsers.insert_after(GrapeSwagger::Roar::Parser, GrapeSwagger::Representable::Parser, Representable::Decorator)
89-
else
90-
GrapeSwagger.model_parsers.register(GrapeSwagger::Representable::Parser, Representable::Decorator)
91-
end
83+
GrapeSwagger.model_parsers.insert_after(GrapeSwagger::Roar::Parser, GrapeSwagger::Representable::Parser, Representable::Decorator)
9284
```
9385

94-
As we know, `Roar::Decorator` uses as superclass `Representable::Decorator`, this allow to avoid problem when Roar objects will be processed by `GrapeSwagger::Representable::Parser`, instead `GrapeSwagger::Roar::Parser`
86+
As we know, `Roar::Decorator` uses as superclass `Representable::Decorator`, this allow to avoid problem when Roar objects will be processed by `GrapeSwagger::Representable::Parser`, instead `GrapeSwagger::Roar::Parser`.
9587

9688
<a name="related" />
9789
## Related Projects
@@ -110,10 +102,10 @@ The following versions of grape, grape-entity and grape-swagger can currently be
110102

111103
grape-swagger | swagger spec | grape | grape-entity | representable |
112104
--------------|--------------|-------------------------|--------------|---------------|
113-
0.10.5 | 1.2 | >= 0.10.0 ... <= 0.14.0 | < 0.5.0 | Unsupported |
114-
0.11.0 | 1.2 | >= 0.16.2 | < 0.5.0 | Unsupported |
115-
0.20.1 | 2.0 | >= 0.12.0 ... <= 0.14.0 | <= 0.5.1 | Unsupported |
116-
0.20.3 | 2.0 | >= 0.12.0 ... ~> 0.16.2 | ~> 0.5.1 | Unsupported |
105+
0.10.5 | 1.2 | >= 0.10.0 ... <= 0.14.0 | < 0.5.0 | n/a |
106+
0.11.0 | 1.2 | >= 0.16.2 | < 0.5.0 | n/a |
107+
0.20.1 | 2.0 | >= 0.12.0 ... <= 0.14.0 | <= 0.5.1 | n/a |
108+
0.20.3 | 2.0 | >= 0.12.0 ... ~> 0.16.2 | ~> 0.5.1 | n/a |
117109
0.21.0 (next) | 2.0 | >= 0.12.0 ... <= 0.16.2 | <= 0.5.1 | >= 2.4.1 |
118110

119111
<a name="swagger-spec" />

UPGRADING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Upgrading Grape-swagger
22
=======================
33

4+
### Upgrading to >= 0.21.0
5+
6+
With grape >= 0.21.0, `grape-entity` support moved to separate gem `grape-swagger-entity`, if you use grape entity, update your Gemfile:
7+
8+
```ruby
9+
gem 'grape-swagger'
10+
gem 'grape-swagger-entity'
11+
```
12+
413
### Upgrading to >= 0.10.2
514

615
With grape >= 0.12.0, support for `notes` is replaced by passing a block `detail` option specified. For future compatibility, update your code:

0 commit comments

Comments
 (0)