taro 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -1
  3. data/README.md +77 -14
  4. data/lib/taro/errors.rb +7 -1
  5. data/lib/taro/export/open_api_v3.rb +54 -23
  6. data/lib/taro/rails/active_declarations.rb +1 -1
  7. data/lib/taro/rails/declaration.rb +50 -9
  8. data/lib/taro/rails/generators/install_generator.rb +1 -1
  9. data/lib/taro/rails/generators/templates/errors_type.erb +15 -10
  10. data/lib/taro/rails/normalized_route.rb +8 -0
  11. data/lib/taro/rails/response_validation.rb +7 -57
  12. data/lib/taro/rails/response_validator.rb +109 -0
  13. data/lib/taro/rails/tasks/export.rake +5 -1
  14. data/lib/taro/rails.rb +1 -2
  15. data/lib/taro/types/base_type.rb +2 -0
  16. data/lib/taro/types/coercion.rb +28 -17
  17. data/lib/taro/types/enum_type.rb +2 -2
  18. data/lib/taro/types/field.rb +8 -16
  19. data/lib/taro/types/field_validation.rb +1 -1
  20. data/lib/taro/types/list_type.rb +4 -6
  21. data/lib/taro/types/object_types/free_form_type.rb +1 -0
  22. data/lib/taro/types/object_types/no_content_type.rb +1 -0
  23. data/lib/taro/types/object_types/page_info_type.rb +2 -0
  24. data/lib/taro/types/object_types/page_type.rb +15 -25
  25. data/lib/taro/types/scalar/iso8601_date_type.rb +1 -0
  26. data/lib/taro/types/scalar/iso8601_datetime_type.rb +1 -0
  27. data/lib/taro/types/scalar/timestamp_type.rb +1 -0
  28. data/lib/taro/types/scalar/uuid_v4_type.rb +1 -0
  29. data/lib/taro/types/shared/deprecation.rb +3 -0
  30. data/lib/taro/types/shared/derived_types.rb +27 -0
  31. data/lib/taro/types/shared/errors.rb +3 -1
  32. data/lib/taro/types/shared/fields.rb +6 -5
  33. data/lib/taro/types/shared/item_type.rb +1 -0
  34. data/lib/taro/types/shared/object_coercion.rb +13 -0
  35. data/lib/taro/types/shared/openapi_name.rb +8 -6
  36. data/lib/taro/types/shared/rendering.rb +11 -25
  37. data/lib/taro/version.rb +1 -1
  38. data/tasks/benchmark.rake +1 -1
  39. metadata +7 -5
  40. data/lib/taro/types/shared/derivable_types.rb +0 -9
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janosch Müller
8
+ - Johannes Opper
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2024-11-15 00:00:00.000000000 Z
12
+ date: 2024-11-18 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rack
@@ -27,7 +28,6 @@ dependencies:
27
28
  description: This library provides an object-based type system for RESTful Ruby APIs,
28
29
  with built-in parameter parsing, response rendering, and OpenAPI schema export.
29
30
  email:
30
- - janosch84@gmail.com
31
31
  executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
@@ -62,6 +62,7 @@ files:
62
62
  - lib/taro/rails/param_parsing.rb
63
63
  - lib/taro/rails/railtie.rb
64
64
  - lib/taro/rails/response_validation.rb
65
+ - lib/taro/rails/response_validator.rb
65
66
  - lib/taro/rails/route_finder.rb
66
67
  - lib/taro/rails/tasks/export.rake
67
68
  - lib/taro/types.rb
@@ -89,7 +90,8 @@ files:
89
90
  - lib/taro/types/shared.rb
90
91
  - lib/taro/types/shared/additional_properties.rb
91
92
  - lib/taro/types/shared/custom_field_resolvers.rb
92
- - lib/taro/types/shared/derivable_types.rb
93
+ - lib/taro/types/shared/deprecation.rb
94
+ - lib/taro/types/shared/derived_types.rb
93
95
  - lib/taro/types/shared/description.rb
94
96
  - lib/taro/types/shared/errors.rb
95
97
  - lib/taro/types/shared/fields.rb
@@ -124,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
126
  - !ruby/object:Gem::Version
125
127
  version: '0'
126
128
  requirements: []
127
- rubygems_version: 3.5.16
129
+ rubygems_version: 3.5.22
128
130
  signing_key:
129
131
  specification_version: 4
130
132
  summary: Typed Api using Ruby Objects.
@@ -1,9 +0,0 @@
1
- module Taro::Types::Shared::DerivableType
2
- def for(type)
3
- derived_types[type] ||= Class.new(self).tap { |t| t.item_type = type }
4
- end
5
-
6
- def derived_types
7
- @derived_types ||= {}
8
- end
9
- end