Commit 653bcbe
committed
Fix Correctly handle class types like Time in documentation
This commit fixes an issue where specifying a class like `Time`
for the `type` option in `expose` documentation resulted in an error
instead of generating the correct Swagger/OpenAPI specification.
This functionality was working correctly in v0.5.5 but regressed
after PR #75, leading to the following error:
```
GrapeSwagger::Errors::UnregisteredParser:
No parser registered for Time.
```
The `primitive_type?` method now uses
`GrapeSwagger::DocMethods::DataType.call` to resolve the type
name before checking if it's a primitive type.
This ensures that types like `Time` are correctly identified as
strings with the `date-time` format, restoring the previous behavior.1 parent 4bdb457 commit 653bcbe
4 files changed
Lines changed: 6 additions & 5 deletions
File tree
- lib/grape-swagger/entity
- spec
- grape-swagger/entities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
0 commit comments