w3c_api 0.1.3 → 0.1.5
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +16 -1
- data/.rubocop_todo.yml +23 -32
- data/README.adoc +297 -827
- data/Rakefile +3 -3
- data/demo/rate_limiting_demo.rb +135 -0
- data/demo/test_embed_functionality.rb +88 -0
- data/demo/test_improved_embed_functionality.rb +92 -0
- data/examples/rate_limiting_stress_test.rb +239 -0
- data/exe/w3c_api +1 -1
- data/lib/w3c_api/cli.rb +29 -28
- data/lib/w3c_api/client.rb +30 -7
- data/lib/w3c_api/commands/affiliation.rb +15 -12
- data/lib/w3c_api/commands/ecosystem.rb +22 -15
- data/lib/w3c_api/commands/group.rb +32 -25
- data/lib/w3c_api/commands/output_formatter.rb +1 -1
- data/lib/w3c_api/commands/participation.rb +11 -9
- data/lib/w3c_api/commands/series.rb +11 -9
- data/lib/w3c_api/commands/specification.rb +59 -45
- data/lib/w3c_api/commands/specification_version.rb +21 -12
- data/lib/w3c_api/commands/translation.rb +7 -6
- data/lib/w3c_api/commands/user.rb +36 -24
- data/lib/w3c_api/embed.rb +40 -0
- data/lib/w3c_api/hal.rb +374 -164
- data/lib/w3c_api/models/account.rb +3 -3
- data/lib/w3c_api/models/affiliation.rb +8 -7
- data/lib/w3c_api/models/affiliation_index.rb +3 -2
- data/lib/w3c_api/models/call_for_translation.rb +4 -3
- data/lib/w3c_api/models/chair_index.rb +2 -2
- data/lib/w3c_api/models/charter.rb +5 -5
- data/lib/w3c_api/models/charter_index.rb +3 -2
- data/lib/w3c_api/models/connected_account.rb +2 -2
- data/lib/w3c_api/models/deliverer_index.rb +3 -2
- data/lib/w3c_api/models/ecosystem.rb +8 -6
- data/lib/w3c_api/models/ecosystem_index.rb +3 -2
- data/lib/w3c_api/models/editor_index.rb +2 -2
- data/lib/w3c_api/models/evangelist_index.rb +3 -2
- data/lib/w3c_api/models/group.rb +16 -13
- data/lib/w3c_api/models/group_index.rb +2 -2
- data/lib/w3c_api/models/groups.rb +2 -2
- data/lib/w3c_api/models/participant_index.rb +3 -2
- data/lib/w3c_api/models/participation.rb +6 -5
- data/lib/w3c_api/models/participation_index.rb +3 -2
- data/lib/w3c_api/models/photo.rb +1 -1
- data/lib/w3c_api/models/serie.rb +6 -4
- data/lib/w3c_api/models/serie_index.rb +3 -2
- data/lib/w3c_api/models/spec_version.rb +10 -7
- data/lib/w3c_api/models/spec_version_index.rb +3 -2
- data/lib/w3c_api/models/spec_version_predecessor_index.rb +3 -2
- data/lib/w3c_api/models/spec_version_successor_index.rb +3 -2
- data/lib/w3c_api/models/specification.rb +17 -9
- data/lib/w3c_api/models/specification_index.rb +3 -2
- data/lib/w3c_api/models/team_contact_index.rb +3 -2
- data/lib/w3c_api/models/testimonial.rb +2 -2
- data/lib/w3c_api/models/translation.rb +4 -4
- data/lib/w3c_api/models/translation_index.rb +3 -2
- data/lib/w3c_api/models/user.rb +16 -11
- data/lib/w3c_api/models/user_index.rb +2 -2
- data/lib/w3c_api/models.rb +52 -37
- data/lib/w3c_api/version.rb +1 -1
- data/lib/w3c_api.rb +8 -7
- metadata +10 -19
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "lutaml/hal"
|
4
4
|
# {
|
5
5
|
# "created": "2021-03-12T22:06:06+00:00",
|
6
6
|
# "service": "github",
|
@@ -27,7 +27,7 @@ module W3cApi
|
|
27
27
|
attribute :profile_picture, :string
|
28
28
|
attribute :href, :string
|
29
29
|
|
30
|
-
hal_link :user, key:
|
30
|
+
hal_link :user, key: "user", realize_class: "User"
|
31
31
|
|
32
32
|
key_value do
|
33
33
|
%i[
|
@@ -38,7 +38,7 @@ module W3cApi
|
|
38
38
|
service
|
39
39
|
profile_picture
|
40
40
|
].each do |key|
|
41
|
-
map key.to_s.tr(
|
41
|
+
map key.to_s.tr("_", "-"), to: key
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -36,7 +36,7 @@
|
|
36
36
|
# "title"=>"Framkom (Forskningsaktiebolaget Medie-och Kommunikationsteknik)"
|
37
37
|
# },
|
38
38
|
|
39
|
-
require_relative
|
39
|
+
require_relative "testimonial"
|
40
40
|
|
41
41
|
module W3cApi
|
42
42
|
module Models
|
@@ -51,11 +51,12 @@ module W3cApi
|
|
51
51
|
attribute :is_member_association, :boolean
|
52
52
|
attribute :is_partner_member, :boolean
|
53
53
|
|
54
|
-
hal_link :self, key:
|
55
|
-
hal_link :homepage, key:
|
56
|
-
hal_link :participants, key:
|
57
|
-
hal_link :participations, key:
|
58
|
-
|
54
|
+
hal_link :self, key: "self", realize_class: "Affiliation"
|
55
|
+
hal_link :homepage, key: "homepage", realize_class: "String"
|
56
|
+
hal_link :participants, key: "participants", realize_class: "Participant"
|
57
|
+
hal_link :participations, key: "participations",
|
58
|
+
realize_class: "Participation"
|
59
|
+
hal_link :logo, key: "logo", realize_class: "String"
|
59
60
|
|
60
61
|
key_value do
|
61
62
|
%i[
|
@@ -67,7 +68,7 @@ module W3cApi
|
|
67
68
|
is_member_association
|
68
69
|
is_partner_member
|
69
70
|
].each do |key|
|
70
|
-
map key.to_s.tr(
|
71
|
+
map key.to_s.tr("_", "-"), to: key
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "affiliation"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Represents a collection of W3C affiliations.
|
8
8
|
class AffiliationIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :affiliations, key:
|
9
|
+
hal_link :affiliations, key: "affiliations",
|
10
|
+
realize_class: "Affiliation", collection: true
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -19,15 +19,16 @@ module W3cApi
|
|
19
19
|
attribute :uri, :string
|
20
20
|
attribute :title, :string
|
21
21
|
|
22
|
-
hal_link :self, key:
|
23
|
-
hal_link :translations, key:
|
22
|
+
hal_link :self, key: "self", realize_class: "CallForTranslation"
|
23
|
+
hal_link :translations, key: "translations",
|
24
|
+
realize_class: "TranslationIndex"
|
24
25
|
|
25
26
|
key_value do
|
26
27
|
%i[
|
27
28
|
uri
|
28
29
|
title
|
29
30
|
].each do |key|
|
30
|
-
map key.to_s.tr(
|
31
|
+
map key.to_s.tr("_", "-"), to: key
|
31
32
|
end
|
32
33
|
end
|
33
34
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class ChairIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :chairs, key:
|
8
|
+
hal_link :chairs, key: "chairs", realize_class: "User", collection: true
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "extension"
|
4
4
|
|
5
5
|
# https://api.w3.org/groups/109735/charters/361
|
6
6
|
# {
|
@@ -45,9 +45,9 @@ module W3cApi
|
|
45
45
|
attribute :required_new_commitments, :boolean
|
46
46
|
attribute :patent_policy, :string
|
47
47
|
|
48
|
-
hal_link :self, key:
|
49
|
-
hal_link :group, key:
|
50
|
-
hal_link :next_charter, key:
|
48
|
+
hal_link :self, key: "self", realize_class: "Charter"
|
49
|
+
hal_link :group, key: "group", realize_class: "Group"
|
50
|
+
hal_link :next_charter, key: "next-charter", realize_class: "Charter"
|
51
51
|
|
52
52
|
key_value do
|
53
53
|
%i[
|
@@ -61,7 +61,7 @@ module W3cApi
|
|
61
61
|
required_new_commitments
|
62
62
|
patent_policy
|
63
63
|
].each do |key|
|
64
|
-
map key.to_s.tr(
|
64
|
+
map key.to_s.tr("_", "-"), to: key
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "charter"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class CharterIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :charters, key:
|
8
|
+
hal_link :charters, key: "charters", realize_class: "Charter",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -26,7 +26,7 @@ module W3cApi
|
|
26
26
|
attribute :profile_picture, :string
|
27
27
|
attribute :href, :string
|
28
28
|
|
29
|
-
hal_link :user, key:
|
29
|
+
hal_link :user, key: "user", realize_class: "User"
|
30
30
|
|
31
31
|
key_value do
|
32
32
|
%i[
|
@@ -37,7 +37,7 @@ module W3cApi
|
|
37
37
|
nickname
|
38
38
|
profile_picture
|
39
39
|
].each do |key|
|
40
|
-
map key.to_s.tr(
|
40
|
+
map key.to_s.tr("_", "-"), to: key
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "group"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Collection of deliverers (working groups)
|
8
8
|
class DelivererIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :deliverers, key:
|
9
|
+
hal_link :deliverers, key: "deliverers", realize_class: "Group",
|
10
|
+
collection: true
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -31,18 +31,20 @@ module W3cApi
|
|
31
31
|
attribute :href, :string
|
32
32
|
attribute :title, :string
|
33
33
|
|
34
|
-
hal_link :self, key:
|
35
|
-
hal_link :champion, key:
|
36
|
-
hal_link :evangelists, key:
|
37
|
-
|
38
|
-
hal_link :
|
34
|
+
hal_link :self, key: "self", realize_class: "Ecosystem"
|
35
|
+
hal_link :champion, key: "champion", realize_class: "User"
|
36
|
+
hal_link :evangelists, key: "evangelists",
|
37
|
+
realize_class: "EvangelistIndex"
|
38
|
+
hal_link :groups, key: "groups", realize_class: "GroupIndex"
|
39
|
+
hal_link :member_organizations, key: "member-organizations",
|
40
|
+
realize_class: "AffiliationIndex"
|
39
41
|
|
40
42
|
key_value do
|
41
43
|
%i[
|
42
44
|
name
|
43
45
|
shortname
|
44
46
|
].each do |key|
|
45
|
-
map key.to_s.tr(
|
47
|
+
map key.to_s.tr("_", "-"), to: key
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "ecosystem"
|
4
4
|
|
5
5
|
# {
|
6
6
|
# "page": 1,
|
@@ -21,7 +21,8 @@ require_relative 'ecosystem'
|
|
21
21
|
module W3cApi
|
22
22
|
module Models
|
23
23
|
class EcosystemIndex < Lutaml::Hal::Page
|
24
|
-
hal_link :ecosystems, key:
|
24
|
+
hal_link :ecosystems, key: "ecosystems", realize_class: "Ecosystem",
|
25
|
+
collection: true
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Collection of editors
|
8
8
|
class EditorIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :editors, key:
|
9
|
+
hal_link :editors, key: "editors", realize_class: "User", collection: true
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class EvangelistIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :evangelists, key:
|
8
|
+
hal_link :evangelists, key: "evangelists", realize_class: "User",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/w3c_api/models/group.rb
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
# "id": 109735,
|
6
6
|
# "name": "Immersive Web Working Group",
|
7
7
|
# "is_closed": false,
|
8
|
-
# "description": "The mission of the Immersive Web Working Group is to help bring high-performance Virtual Reality (VR) and Augmented Reality (AR)
|
8
|
+
# "description": "The mission of the Immersive Web Working Group is to help bring high-performance Virtual Reality (VR) and Augmented Reality (AR) " \
|
9
|
+
# "(collectively known as XR) to the open Web via APIs to interact with XR devices and sensors in browsers.",
|
9
10
|
# "shortname": "immersive-web",
|
10
11
|
# "discr": "w3cgroup",
|
11
12
|
# "_links": {
|
@@ -63,18 +64,20 @@ module W3cApi
|
|
63
64
|
attribute :shortname, :string
|
64
65
|
attribute :discr, :string
|
65
66
|
|
66
|
-
hal_link :self, key:
|
67
|
-
hal_link :homepage, key:
|
68
|
-
hal_link :users, key:
|
67
|
+
hal_link :self, key: "self", realize_class: "Group"
|
68
|
+
hal_link :homepage, key: "homepage", realize_class: "String"
|
69
|
+
hal_link :users, key: "users", realize_class: "UserIndex"
|
69
70
|
# hal_link :services, key: 'services', realize_class: 'ServiceIndex'
|
70
|
-
hal_link :specifications, key:
|
71
|
-
|
72
|
-
hal_link :
|
73
|
-
hal_link :
|
74
|
-
hal_link :
|
75
|
-
hal_link :
|
76
|
-
hal_link :
|
77
|
-
hal_link :
|
71
|
+
hal_link :specifications, key: "specifications",
|
72
|
+
realize_class: "SpecificationIndex"
|
73
|
+
hal_link :chairs, key: "chairs", realize_class: "UserIndex"
|
74
|
+
hal_link :team_contacts, key: "team-contacts", realize_class: "UserIndex"
|
75
|
+
hal_link :charters, key: "charters", realize_class: "CharterIndex"
|
76
|
+
hal_link :active_charters, key: "active-charter", realize_class: "Charter"
|
77
|
+
hal_link :join, key: "join", realize_class: "String"
|
78
|
+
hal_link :pp_status, key: "pp-status", realize_class: "String"
|
79
|
+
hal_link :participations, key: "participations",
|
80
|
+
realize_class: "ParticipationIndex"
|
78
81
|
|
79
82
|
key_value do
|
80
83
|
%i[
|
@@ -86,7 +89,7 @@ module W3cApi
|
|
86
89
|
shortname
|
87
90
|
discr
|
88
91
|
].each do |key|
|
89
|
-
map key.to_s.tr(
|
92
|
+
map key.to_s.tr("_", "-"), to: key
|
90
93
|
end
|
91
94
|
end
|
92
95
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "group"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# Collection of groups
|
8
8
|
class GroupIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :groups, key:
|
9
|
+
hal_link :groups, key: "groups", realize_class: "Group", collection: true
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class ParticipantIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :participants, key:
|
8
|
+
hal_link :participants, key: "participants", realize_class: "User",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -31,10 +31,11 @@ module W3cApi
|
|
31
31
|
attribute :individual, :boolean
|
32
32
|
attribute :invited_expert, :boolean
|
33
33
|
|
34
|
-
hal_link :self, key:
|
35
|
-
hal_link :group, key:
|
36
|
-
hal_link :organization, key:
|
37
|
-
hal_link :participants, key:
|
34
|
+
hal_link :self, key: "self", realize_class: "Participation"
|
35
|
+
hal_link :group, key: "group", realize_class: "Group"
|
36
|
+
hal_link :organization, key: "organization", realize_class: "Affiliation"
|
37
|
+
hal_link :participants, key: "participants",
|
38
|
+
realize_class: "ParticipantIndex"
|
38
39
|
|
39
40
|
key_value do
|
40
41
|
%i[
|
@@ -42,7 +43,7 @@ module W3cApi
|
|
42
43
|
invited_expert
|
43
44
|
created
|
44
45
|
].each do |key|
|
45
|
-
map key.to_s.tr(
|
46
|
+
map key.to_s.tr("_", "-"), to: key
|
46
47
|
end
|
47
48
|
end
|
48
49
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "participation"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class ParticipationIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :participations, key:
|
8
|
+
hal_link :participations, key: "participations",
|
9
|
+
realize_class: "Participation", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/w3c_api/models/photo.rb
CHANGED
data/lib/w3c_api/models/serie.rb
CHANGED
@@ -41,16 +41,18 @@ module W3cApi
|
|
41
41
|
attribute :href, :string
|
42
42
|
attribute :title, :string
|
43
43
|
|
44
|
-
hal_link :self, key:
|
45
|
-
hal_link :specifications, key:
|
46
|
-
|
44
|
+
hal_link :self, key: "self", realize_class: "Serie"
|
45
|
+
hal_link :specifications, key: "specifications",
|
46
|
+
realize_class: "SpecificationIndex"
|
47
|
+
hal_link :current_specification, key: "current-specification",
|
48
|
+
realize_class: "SpecVersion"
|
47
49
|
|
48
50
|
key_value do
|
49
51
|
%i[
|
50
52
|
shortname
|
51
53
|
name
|
52
54
|
].each do |key|
|
53
|
-
map key.to_s.tr(
|
55
|
+
map key.to_s.tr("_", "-"), to: key
|
54
56
|
end
|
55
57
|
end
|
56
58
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "serie"
|
4
4
|
|
5
5
|
# https://api.w3.org/specification-series
|
6
6
|
# {
|
@@ -44,7 +44,8 @@ require_relative 'serie'
|
|
44
44
|
module W3cApi
|
45
45
|
module Models
|
46
46
|
class SerieIndex < Lutaml::Hal::Page
|
47
|
-
hal_link :series, key:
|
47
|
+
hal_link :series, key: "specification-series", realize_class: "Serie",
|
48
|
+
collection: true
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -48,12 +48,15 @@ module W3cApi
|
|
48
48
|
attribute :errata, :string
|
49
49
|
attribute :process_rules, :string
|
50
50
|
|
51
|
-
hal_link :self, key:
|
52
|
-
hal_link :editors, key:
|
53
|
-
hal_link :deliverers, key:
|
54
|
-
hal_link :specification, key:
|
55
|
-
|
56
|
-
hal_link :
|
51
|
+
hal_link :self, key: "self", realize_class: "SpecVersion"
|
52
|
+
hal_link :editors, key: "editors", realize_class: "EditorIndex"
|
53
|
+
hal_link :deliverers, key: "deliverers", realize_class: "DelivererIndex"
|
54
|
+
hal_link :specification, key: "specification",
|
55
|
+
realize_class: "Specification"
|
56
|
+
hal_link :predecessor_versions, key: "predecessor-version",
|
57
|
+
realize_class: "SpecVersionPredecessorIndex"
|
58
|
+
hal_link :successor_versions, key: "successor-version",
|
59
|
+
realize_class: "SpecVersionSuccessorIndex"
|
57
60
|
|
58
61
|
key_value do
|
59
62
|
%i[
|
@@ -74,7 +77,7 @@ module W3cApi
|
|
74
77
|
errata
|
75
78
|
process_rules
|
76
79
|
].each do |key|
|
77
|
-
map key.to_s.tr(
|
80
|
+
map key.to_s.tr("_", "-"), to: key
|
78
81
|
end
|
79
82
|
end
|
80
83
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "spec_version"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :spec_versions, key:
|
8
|
+
hal_link :spec_versions, key: "version-history",
|
9
|
+
realize_class: "SpecVersion", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "spec_version"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionPredecessorIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :predecessor_versions, key:
|
8
|
+
hal_link :predecessor_versions, key: "predecessor-version",
|
9
|
+
realize_class: "SpecVersion", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "spec_version"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class SpecVersionSuccessorIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :successor_versions, key:
|
8
|
+
hal_link :successor_versions, key: "successor-version",
|
9
|
+
realize_class: "SpecVersion", collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -3,7 +3,10 @@
|
|
3
3
|
# https://api.w3.org/specifications/html5
|
4
4
|
# {
|
5
5
|
# "shortlink": "https://www.w3.org/TR/html5/",
|
6
|
-
# "description": "<p>This specification defines the 5th major revision of the core language of the World Wide Web: the Hypertext Markup Language (HTML).
|
6
|
+
# "description": "<p>This specification defines the 5th major revision of the core language of the World Wide Web: the Hypertext Markup Language (HTML). " \
|
7
|
+
# "In this version, new features are introduced to help Web application authors, new elements are introduced based on research " \
|
8
|
+
# "into prevailing authoring practices, " \
|
9
|
+
# "and special attention has been given to defining clear conformance criteria for user agents in an effort to improve interoperability.</p>",
|
7
10
|
# "title": "HTML5",
|
8
11
|
# "shortname": "html5",
|
9
12
|
# "series-version": "5",
|
@@ -42,13 +45,18 @@ module W3cApi
|
|
42
45
|
attribute :editor_draft, :string
|
43
46
|
attribute :series_version, :string
|
44
47
|
|
45
|
-
hal_link :self, key:
|
46
|
-
hal_link :version_history, key:
|
47
|
-
|
48
|
-
hal_link :
|
49
|
-
|
50
|
-
hal_link :
|
51
|
-
|
48
|
+
hal_link :self, key: "self", realize_class: "Specification"
|
49
|
+
hal_link :version_history, key: "version-history",
|
50
|
+
realize_class: "SpecVersionIndex"
|
51
|
+
hal_link :first_version, key: "first-version",
|
52
|
+
realize_class: "SpecVersion"
|
53
|
+
hal_link :latest_version, key: "latest-version",
|
54
|
+
realize_class: "SpecVersion"
|
55
|
+
hal_link :supersedes, key: "supersedes",
|
56
|
+
realize_class: "SpecificationIndex", collection: true
|
57
|
+
hal_link :series, key: "series", realize_class: "Serie"
|
58
|
+
hal_link :spec_versions, key: "version-history",
|
59
|
+
realize_class: "SpecVersionIndex"
|
52
60
|
|
53
61
|
key_value do
|
54
62
|
%i[
|
@@ -60,7 +68,7 @@ module W3cApi
|
|
60
68
|
editor_draft
|
61
69
|
series_version
|
62
70
|
].each do |key|
|
63
|
-
map key.to_s.tr(
|
71
|
+
map key.to_s.tr("_", "-"), to: key
|
64
72
|
end
|
65
73
|
end
|
66
74
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "specification"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
# SpecificationIndex class that models `/specifications`
|
8
8
|
class SpecificationIndex < Lutaml::Hal::Page
|
9
|
-
hal_link :specifications, key:
|
9
|
+
hal_link :specifications, key: "specifications",
|
10
|
+
realize_class: "Specification", collection: true
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "user"
|
4
4
|
|
5
5
|
module W3cApi
|
6
6
|
module Models
|
7
7
|
class TeamContactIndex < Lutaml::Hal::Page
|
8
|
-
hal_link :team_contacts, key:
|
8
|
+
hal_link :team_contacts, key: "team-contacts", realize_class: "User",
|
9
|
+
collection: true
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|