media_types-serialization 1.3.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +32 -32
  3. data/.github/workflows/publish-bookworm.yml +33 -0
  4. data/.github/workflows/publish-sid.yml +33 -0
  5. data/.gitignore +22 -12
  6. data/.idea/.rakeTasks +7 -7
  7. data/.idea/dictionaries/Derk_Jan.xml +6 -6
  8. data/.idea/encodings.xml +3 -3
  9. data/.idea/inspectionProfiles/Project_Default.xml +5 -5
  10. data/.idea/media_types-serialization.iml +76 -76
  11. data/.idea/misc.xml +6 -6
  12. data/.idea/modules.xml +7 -7
  13. data/.idea/runConfigurations/test.xml +19 -19
  14. data/.idea/vcs.xml +5 -5
  15. data/CHANGELOG.md +190 -178
  16. data/CODE_OF_CONDUCT.md +74 -74
  17. data/Gemfile +4 -4
  18. data/LICENSE.txt +21 -21
  19. data/README.md +1048 -1035
  20. data/Rakefile +10 -10
  21. data/bin/console +14 -14
  22. data/bin/setup +8 -8
  23. data/lib/media_types/problem.rb +67 -67
  24. data/lib/media_types/serialization/base.rb +269 -216
  25. data/lib/media_types/serialization/error.rb +193 -193
  26. data/lib/media_types/serialization/fake_validator.rb +53 -53
  27. data/lib/media_types/serialization/serialization_dsl.rb +135 -117
  28. data/lib/media_types/serialization/serialization_registration.rb +245 -245
  29. data/lib/media_types/serialization/serializers/api_viewer.rb +383 -136
  30. data/lib/media_types/serialization/serializers/common_css.rb +212 -168
  31. data/lib/media_types/serialization/serializers/endpoint_description_serializer.rb +80 -80
  32. data/lib/media_types/serialization/serializers/fallback_not_acceptable_serializer.rb +85 -85
  33. data/lib/media_types/serialization/serializers/fallback_unsupported_media_type_serializer.rb +58 -58
  34. data/lib/media_types/serialization/serializers/input_validation_error_serializer.rb +93 -93
  35. data/lib/media_types/serialization/serializers/problem_serializer.rb +111 -104
  36. data/lib/media_types/serialization/utils/accept_header.rb +77 -77
  37. data/lib/media_types/serialization/utils/accept_language_header.rb +82 -82
  38. data/lib/media_types/serialization/version.rb +7 -7
  39. data/lib/media_types/serialization.rb +682 -671
  40. data/media_types-serialization.gemspec +48 -48
  41. metadata +17 -16
  42. data/Gemfile.lock +0 -137
@@ -1,48 +1,48 @@
1
-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'media_types/serialization/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'media_types-serialization'
8
- spec.version = MediaTypes::Serialization::VERSION
9
- spec.authors = ['Derk-Jan Karrenbeld', 'Max Maton']
10
- spec.email = ['derk-jan@xpbytes.com', 'max@delftsolutions.nl']
11
-
12
- spec.summary = 'Add media types supported serialization using your favourite serializer'
13
- spec.homepage = 'https://github.com/XPBytes/media_types-serialization'
14
- spec.license = 'MIT'
15
-
16
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
- # to allow pushing to a single host or delete this section to allow pushing to any host.
18
- if spec.respond_to?(:metadata)
19
- # spec.metadata['allowed_push_host'] = 'TODO: Set to 'http://mygemserver.com''
20
-
21
- spec.metadata['homepage_uri'] = spec.homepage
22
- spec.metadata['source_code_uri'] = spec.homepage
23
- spec.metadata['changelog_uri'] = spec.homepage + '/blob/master/CHANGELOG.md'
24
- else
25
- raise 'RubyGems 2.0 or newer is required to protect against ' \
26
- 'public gem pushes.'
27
- end
28
-
29
- # Specify which files should be added to the gem when it is released.
30
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
32
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
- end
34
- spec.bindir = 'exe'
35
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
- spec.require_paths = ['lib']
37
-
38
- spec.add_dependency 'actionpack', '>= 4.0.0'
39
- spec.add_dependency 'activesupport', '>= 4.0.0'
40
- spec.add_dependency 'media_types', '>= 2.1.1', '< 3.0.0'
41
-
42
- spec.add_development_dependency 'awesome_print'
43
- spec.add_development_dependency 'bundler'
44
- spec.add_development_dependency 'rails', '~> 5.2'
45
- spec.add_development_dependency 'rake', '~> 13.0'
46
- spec.add_development_dependency 'minitest', '~> 5.0'
47
- spec.add_development_dependency 'oj'
48
- end
1
+
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'media_types/serialization/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'media_types-serialization'
8
+ spec.version = MediaTypes::Serialization::VERSION
9
+ spec.authors = ['Derk-Jan Karrenbeld', 'Max Maton']
10
+ spec.email = ['derk-jan@xpbytes.com', 'max@delftsolutions.nl']
11
+
12
+ spec.summary = 'Add media types supported serialization using your favourite serializer'
13
+ spec.homepage = 'https://github.com/XPBytes/media_types-serialization'
14
+ spec.license = 'MIT'
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = 'TODO: Set to 'http://mygemserver.com''
20
+
21
+ spec.metadata['homepage_uri'] = spec.homepage
22
+ spec.metadata['source_code_uri'] = spec.homepage
23
+ spec.metadata['changelog_uri'] = spec.homepage + '/blob/master/CHANGELOG.md'
24
+ else
25
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
26
+ 'public gem pushes.'
27
+ end
28
+
29
+ # Specify which files should be added to the gem when it is released.
30
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
32
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
+ end
34
+ spec.bindir = 'exe'
35
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
+ spec.require_paths = ['lib']
37
+
38
+ spec.add_dependency 'actionpack', '>= 6.0.0'
39
+ spec.add_dependency 'activesupport', '>= 6.0.0'
40
+ spec.add_dependency 'media_types', '>= 2.2.0', '< 3.0.0'
41
+
42
+ spec.add_development_dependency 'awesome_print'
43
+ spec.add_development_dependency 'bundler'
44
+ spec.add_development_dependency 'rails', '~> 6.0'
45
+ spec.add_development_dependency 'rake', '~> 13.0'
46
+ spec.add_development_dependency 'minitest', '~> 5.0'
47
+ spec.add_development_dependency 'oj'
48
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_types-serialization
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.9
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derk-Jan Karrenbeld
8
8
  - Max Maton
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-11-04 00:00:00.000000000 Z
12
+ date: 2023-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -17,35 +17,35 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 4.0.0
20
+ version: 6.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 4.0.0
27
+ version: 6.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activesupport
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 4.0.0
34
+ version: 6.0.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 4.0.0
41
+ version: 6.0.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: media_types
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 2.1.1
48
+ version: 2.2.0
49
49
  - - "<"
50
50
  - !ruby/object:Gem::Version
51
51
  version: 3.0.0
@@ -55,7 +55,7 @@ dependencies:
55
55
  requirements:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
- version: 2.1.1
58
+ version: 2.2.0
59
59
  - - "<"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.0.0
@@ -93,14 +93,14 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '5.2'
96
+ version: '6.0'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '5.2'
103
+ version: '6.0'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rake
106
106
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ dependencies:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
- description:
146
+ description:
147
147
  email:
148
148
  - derk-jan@xpbytes.com
149
149
  - max@delftsolutions.nl
@@ -152,6 +152,8 @@ extensions: []
152
152
  extra_rdoc_files: []
153
153
  files:
154
154
  - ".github/workflows/ci.yml"
155
+ - ".github/workflows/publish-bookworm.yml"
156
+ - ".github/workflows/publish-sid.yml"
155
157
  - ".gitignore"
156
158
  - ".idea/.rakeTasks"
157
159
  - ".idea/dictionaries/Derk_Jan.xml"
@@ -166,7 +168,6 @@ files:
166
168
  - CHANGELOG.md
167
169
  - CODE_OF_CONDUCT.md
168
170
  - Gemfile
169
- - Gemfile.lock
170
171
  - LICENSE.txt
171
172
  - README.md
172
173
  - Rakefile
@@ -198,7 +199,7 @@ metadata:
198
199
  homepage_uri: https://github.com/XPBytes/media_types-serialization
199
200
  source_code_uri: https://github.com/XPBytes/media_types-serialization
200
201
  changelog_uri: https://github.com/XPBytes/media_types-serialization/blob/master/CHANGELOG.md
201
- post_install_message:
202
+ post_install_message:
202
203
  rdoc_options: []
203
204
  require_paths:
204
205
  - lib
@@ -213,8 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
214
  - !ruby/object:Gem::Version
214
215
  version: '0'
215
216
  requirements: []
216
- rubygems_version: 3.1.6
217
- signing_key:
217
+ rubygems_version: 3.2.5
218
+ signing_key:
218
219
  specification_version: 4
219
220
  summary: Add media types supported serialization using your favourite serializer
220
221
  test_files: []
data/Gemfile.lock DELETED
@@ -1,137 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- media_types-serialization (1.3.9)
5
- actionpack (>= 4.0.0)
6
- activesupport (>= 4.0.0)
7
- media_types (>= 2.1.1, < 3.0.0)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (5.2.6)
13
- actionpack (= 5.2.6)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- actionmailer (5.2.6)
17
- actionpack (= 5.2.6)
18
- actionview (= 5.2.6)
19
- activejob (= 5.2.6)
20
- mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 2.0)
22
- actionpack (5.2.6)
23
- actionview (= 5.2.6)
24
- activesupport (= 5.2.6)
25
- rack (~> 2.0, >= 2.0.8)
26
- rack-test (>= 0.6.3)
27
- rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.2.6)
30
- activesupport (= 5.2.6)
31
- builder (~> 3.1)
32
- erubi (~> 1.4)
33
- rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.2.6)
36
- activesupport (= 5.2.6)
37
- globalid (>= 0.3.6)
38
- activemodel (5.2.6)
39
- activesupport (= 5.2.6)
40
- activerecord (5.2.6)
41
- activemodel (= 5.2.6)
42
- activesupport (= 5.2.6)
43
- arel (>= 9.0)
44
- activestorage (5.2.6)
45
- actionpack (= 5.2.6)
46
- activerecord (= 5.2.6)
47
- marcel (~> 1.0.0)
48
- activesupport (5.2.6)
49
- concurrent-ruby (~> 1.0, >= 1.0.2)
50
- i18n (>= 0.7, < 2)
51
- minitest (~> 5.1)
52
- tzinfo (~> 1.1)
53
- arel (9.0.0)
54
- awesome_print (1.9.2)
55
- builder (3.2.4)
56
- concurrent-ruby (1.1.9)
57
- crass (1.0.6)
58
- erubi (1.10.0)
59
- globalid (0.5.2)
60
- activesupport (>= 5.0)
61
- i18n (1.8.10)
62
- concurrent-ruby (~> 1.0)
63
- loofah (2.12.0)
64
- crass (~> 1.0.2)
65
- nokogiri (>= 1.5.9)
66
- mail (2.7.1)
67
- mini_mime (>= 0.1.1)
68
- marcel (1.0.1)
69
- media_types (2.1.1)
70
- method_source (1.0.0)
71
- mini_mime (1.1.0)
72
- minitest (5.14.4)
73
- nio4r (2.5.8)
74
- nokogiri (1.12.3-x64-mingw32)
75
- racc (~> 1.4)
76
- nokogiri (1.12.3-x86_64-linux)
77
- racc (~> 1.4)
78
- oj (3.13.4)
79
- racc (1.5.2)
80
- rack (2.2.3)
81
- rack-test (1.1.0)
82
- rack (>= 1.0, < 3)
83
- rails (5.2.6)
84
- actioncable (= 5.2.6)
85
- actionmailer (= 5.2.6)
86
- actionpack (= 5.2.6)
87
- actionview (= 5.2.6)
88
- activejob (= 5.2.6)
89
- activemodel (= 5.2.6)
90
- activerecord (= 5.2.6)
91
- activestorage (= 5.2.6)
92
- activesupport (= 5.2.6)
93
- bundler (>= 1.3.0)
94
- railties (= 5.2.6)
95
- sprockets-rails (>= 2.0.0)
96
- rails-dom-testing (2.0.3)
97
- activesupport (>= 4.2.0)
98
- nokogiri (>= 1.6)
99
- rails-html-sanitizer (1.4.1)
100
- loofah (~> 2.3)
101
- railties (5.2.6)
102
- actionpack (= 5.2.6)
103
- activesupport (= 5.2.6)
104
- method_source
105
- rake (>= 0.8.7)
106
- thor (>= 0.19.0, < 2.0)
107
- rake (13.0.6)
108
- sprockets (4.0.2)
109
- concurrent-ruby (~> 1.0)
110
- rack (> 1, < 3)
111
- sprockets-rails (3.2.2)
112
- actionpack (>= 4.0)
113
- activesupport (>= 4.0)
114
- sprockets (>= 3.0.0)
115
- thor (1.1.0)
116
- thread_safe (0.3.6)
117
- tzinfo (1.2.9)
118
- thread_safe (~> 0.1)
119
- websocket-driver (0.7.5)
120
- websocket-extensions (>= 0.1.0)
121
- websocket-extensions (0.1.5)
122
-
123
- PLATFORMS
124
- x64-mingw32
125
- x86_64-linux
126
-
127
- DEPENDENCIES
128
- awesome_print
129
- bundler
130
- media_types-serialization!
131
- minitest (~> 5.0)
132
- oj
133
- rails (~> 5.2)
134
- rake (~> 13.0)
135
-
136
- BUNDLED WITH
137
- 2.2.17