lacerda 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91f5bd818b023050eb685876d234aee2759844df
4
- data.tar.gz: d29587aa04edda7df8aa1a18557e4ac8b986699a
3
+ metadata.gz: b0abd7bbf447a5e778f7ab6353422ac1da746309
4
+ data.tar.gz: a85f01085b63ec1e26d28f5000866d1a615ce304
5
5
  SHA512:
6
- metadata.gz: 8f2e8d8336cdc01a964eefa2c3098370823ad82be164505c87add3701dda4209d5b83657694b6933cb909f98fa50ba85e07733cd3745f082941f5fa706382109
7
- data.tar.gz: bdfb411bcb9ca86e2ba1756ab7554674bba344e917b426acd0d568f2dc78ce40a9a28acd18c6292e964a56fb6f72f41a149f1d6df821b88d04893de2d2e849da
6
+ metadata.gz: 71ae229f2d0e11bc7f58bb307ab2020c77264f9a23a235ce7c57c80addc8866fd1a571f4e8018cbb6d048b7512e13ff5b207a757b85b64f3eb6ac08bcceca5aa
7
+ data.tar.gz: 35280a9d3b58f41cd22f74ae0bd978ff2613f5fe6babb90c764649c66343aa12a673585174cb8c9d8c309bf30ad3c0e99a76518ba7c8f8e4458eeacaafd69c45
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.4 (29-Oct-15)
2
+ - validation helpers for published and consumed objects
3
+ - enhance some error messages
4
+
1
5
  # 0.3.3 (28-Oct-15)
2
6
  - add error messages
3
7
 
@@ -3,7 +3,7 @@ module Lacerda
3
3
  class JsonSchema
4
4
  ERRORS = {
5
5
  :ERR_ARRAY_ITEM_MISMATCH => "The items in the published array don't match the consumer's specification.",
6
- :ERR_MISSING_DEFINITION => "The published object is missing a type defined the consumer's specification.",
6
+ :ERR_MISSING_DEFINITION => "The publish specification is missing a type defined in esothe consumer's specification.",
7
7
  :ERR_MISSING_POINTER => "A JSON pointer could not be resolved.",
8
8
  :ERR_MISSING_PROPERTY => "The published object is missing a property required by your specification.",
9
9
  :ERR_MISSING_REQUIRED => "The published object has an optional property that you marked as required in your specification.",
@@ -14,5 +14,11 @@ module Lacerda
14
14
  end
15
15
  filtered_schema
16
16
  end
17
+
18
+ def object(name)
19
+ schema = @schema[:definitions][name.to_s.underscore]
20
+ raise Lacerda::Service::InvalidObjectTypeError.new(name.to_s.underscore) unless schema
21
+ Lacerda::ConsumedObject.new(service, name, schema)
22
+ end
17
23
  end
18
24
  end
@@ -24,6 +24,10 @@ module Lacerda
24
24
  @schema = schema
25
25
  end
26
26
 
27
+ def validate_data!(data)
28
+ JSON::Validator.validate!(@schema, data)
29
+ end
30
+
27
31
  private
28
32
 
29
33
  def remove_service_from_scoped_name(n)
@@ -13,6 +13,19 @@ module Lacerda
13
13
  @comparator.contains?(consumer.consume.scoped_schema(service), consumer.name)
14
14
  end
15
15
 
16
+ def object(name)
17
+ scoped_name = name.to_s.underscore
18
+
19
+ # Add our own prefix automatically if necessary
20
+ unless scoped_name.start_with?(service.name.underscore)
21
+ scoped_name = [service.name.underscore, scoped_name].join(Lacerda::SCOPE_SEPARATOR)
22
+ end
23
+
24
+ schema = @schema[:definitions][scoped_name]
25
+ raise Lacerda::Service::InvalidObjectTypeError.new(scoped_name) unless schema
26
+ Lacerda::PublishedObject.new(service, scoped_name, schema)
27
+ end
28
+
16
29
  private
17
30
 
18
31
  def object_description_class
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/string'
2
+ require 'lacerda/service/error'
2
3
 
3
4
  module Lacerda
4
5
  # Models a service and its published objects as well as consumed
@@ -53,6 +54,30 @@ module Lacerda
53
54
  @errors.empty?
54
55
  end
55
56
 
57
+ def validate_object_to_publish(type, data)
58
+ validate_object_to_publish!(type, data)
59
+ true
60
+ rescue
61
+ false
62
+ end
63
+
64
+ def validate_object_to_publish!(type, data)
65
+ object_description = @publish.object(type)
66
+ object_description.validate_data!(data)
67
+ end
68
+
69
+ def validate_object_to_consume(type, data)
70
+ validate_object_to_consume!(type, data)
71
+ true
72
+ rescue
73
+ false
74
+ end
75
+
76
+ def validate_object_to_consume!(type, data)
77
+ object_description = @consume.object(type)
78
+ object_description.validate_data!(data)
79
+ end
80
+
56
81
  private
57
82
 
58
83
  def load_contracts
@@ -0,0 +1,5 @@
1
+ module Lacerda
2
+ class Service
3
+ class InvalidObjectTypeError < StandardError; end
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Lacerda
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lacerda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jannis Hermanns
@@ -211,17 +211,9 @@ files:
211
211
  - lib/lacerda/publish_contract.rb
212
212
  - lib/lacerda/published_object.rb
213
213
  - lib/lacerda/service.rb
214
+ - lib/lacerda/service/error.rb
214
215
  - lib/lacerda/tasks.rb
215
216
  - lib/lacerda/version.rb
216
- - stuff/contracts/author/consume.mson
217
- - stuff/contracts/author/publish.mson
218
- - stuff/contracts/edward/consume.mson
219
- - stuff/contracts/edward/publish.mson
220
- - stuff/explore/blueprint.apib
221
- - stuff/explore/swagger.yaml
222
- - stuff/explore/test.apib
223
- - stuff/explore/test.mson
224
- - stuff/explore/tmp.txt
225
217
  homepage: https://github.com/moviepilot/lacerda
226
218
  licenses:
227
219
  - MIT
File without changes
@@ -1,20 +0,0 @@
1
- # Data Structures
2
-
3
- Foo
4
-
5
- # Tag
6
-
7
- Guten Tag
8
-
9
- ## Properties
10
- - id: 1 (number, required) - Foobar
11
-
12
- # Post
13
-
14
- Explanation for a post
15
-
16
- ## Properties
17
- - id: 1 (number, required) - The unique identifier for a post
18
- - title: Work from home (string, required) - Title of the product
19
- - author: 2 (number, optional) - External user id of author
20
- - tags: (array[Tag])
@@ -1,7 +0,0 @@
1
- # Data Structures
2
-
3
- ## Author:Post
4
-
5
- - title: (string)
6
- - tag: (object)
7
- - tagname: (string)
File without changes
@@ -1,239 +0,0 @@
1
- FORMAT: 1A
2
- HOST: http://api.moviepilot.com/
3
-
4
- # Edward
5
-
6
- # Status [/v2]
7
-
8
- We'll forward you to the v2 status resource
9
-
10
- ## Retrieve the Entry Point [GET]
11
-
12
- + Response 200 (application/json; charset=utf-8)
13
- + Body
14
- + Attributes
15
- - version: 5.2.1 (string, required) - Version number of currently deployed Edward
16
- - server_time: `2015-08-11T08:19:41.556-07:00` (string, required) - Server's time
17
- - user_id: 888448 (number, optional) - Requesting user's id
18
-
19
- ## Group Posts
20
-
21
- Resources related to posts in the API.
22
-
23
- ## Post [/v4/posts/{id}]
24
-
25
- + Parameters
26
- + id: `3461151` (number, required) - External id
27
-
28
- ### View a post [GET]
29
-
30
- + Response 200 (application/json; charset=utf-8)
31
-
32
- + Body
33
-
34
- {
35
- "id": 3461151,
36
- "slug": "it-would-not-have-cost-marketing-any-more-money-to-add-black-widow-on",
37
- "title": "It would not have cost marketing any more money to add Black Widow on...",
38
- "html_body": "<p>... the cover (or Hawkeye, for that matter). And would it not have been better to take the chance at one more sale by having her on than to lose a sale by not having her on?And don't say that the main characters would then have been smaller because they could have placed Black Widow to the left and behind or above the main characters without changing their relative size.</p>",
39
- "total_comments_count": 0,
40
- "created_at": "2015-08-11T06:23:50.000-07:00",
41
- "questionnaire_id": null,
42
- "template": null,
43
- "abstract": null,
44
- "keywords": null,
45
- "cover_image_url": null,
46
- "cover_image_caption": null,
47
- "seo_title": null,
48
- "social_title": null,
49
- "social_abstract": null,
50
- "suggested_facebook_page_id": "1525889887653500",
51
- "comments_disabled": false,
52
- "is_mobile_post": false,
53
- "legacy_type": "post",
54
- "og_image_url": "http://images-cdn.moviepilot.com/image/upload/v1431953404/pocket_post_big2_ct9cex.png",
55
- "published_at": "2015-08-11T06:23:50.000-07:00",
56
- "first_published_at": "2015-08-11T06:23:50.000-07:00",
57
- "last_published_at": "2015-08-11T06:23:50.000-07:00",
58
- "promoted": null,
59
- "cover_video": {},
60
- "view_count": 0,
61
- "comment_count": 0,
62
- "author": {
63
- "id": 1394326,
64
- "name": "Richard Lemay",
65
- "first_name": "Richard",
66
- "last_name": "Lemay",
67
- "user_name": null,
68
- "image_url": "https://graph.facebook.com/695180451/picture",
69
- "description": null,
70
- "followers_count": 1,
71
- "verified": "contributor",
72
- "user_subscription_count": 3,
73
- "weekly_readers": 0,
74
- "contributions_count": 1,
75
- "contribution_view_count": 0,
76
- "contribution_comments_count": 0,
77
- "facebook_id": "695180451",
78
- "twitter_handle": null,
79
- "location": null,
80
- "avatar_image_url": null,
81
- "cover_image_url": null,
82
- "provider_image_url": "https://graph.facebook.com/695180451/picture",
83
- "flags": [],
84
- "roles": [
85
- "contributor"
86
- ],
87
- "profile_public": true,
88
- "auto_promote_posts": true
89
- },
90
- "in_reply_to": {
91
- "id": 3457913,
92
- "type": "post",
93
- "first_published_at": "2015-08-10T07:02:09.000-07:00",
94
- "last_published_at": "2015-08-10T07:17:08.000-07:00",
95
- "slug": "black-widow-was-just-snubbed-by-marvel-again",
96
- "title": "Black Widow Was Just Snubbed by Marvel...AGAIN",
97
- "author": {
98
- "id": 1311215,
99
- "name": "Kit Simpson Browne",
100
- "user_name": "Kitsb"
101
- }
102
- },
103
- "related_objects": [
104
- {
105
- "id": 205406,
106
- "type": "tag",
107
- "slug": "superheroes",
108
- "name": "Superheroes",
109
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_237,t_mp_quality,w_600/-14cf0c53-33e1-41be-abb6-4490542ec6db.gif",
110
- "subscriber_count": 45802
111
- },
112
- {
113
- "id": 932254,
114
- "type": "tag",
115
- "slug": "marvel",
116
- "name": "Marvel",
117
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_211,t_mp_quality,w_500/-76cc31d4-897f-486c-9dbb-8e22fd30cf1b.gif",
118
- "subscriber_count": 8627
119
- },
120
- {
121
- "id": 958506,
122
- "type": "tag",
123
- "slug": "casting",
124
- "name": "Casting",
125
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_400,t_mp_quality,w_960/-364bed3a-81c7-4e44-8735-3500b536e23d.jpg",
126
- "subscriber_count": 668
127
- },
128
- {
129
- "id": 958518,
130
- "type": "tag",
131
- "slug": "opinion",
132
- "name": "Opinion",
133
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_205,t_mp_quality,w_400/-f08c141c-387b-4dc2-a399-8aadd4084155.gif",
134
- "subscriber_count": 236
135
- },
136
- {
137
- "id": 958527,
138
- "type": "tag",
139
- "slug": "industry",
140
- "name": "Industry",
141
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_235,t_mp_quality,w_416/-71298c11-8adb-4db0-8375-7d921f732dc2.gif",
142
- "subscriber_count": 9
143
- },
144
- {
145
- "id": 958545,
146
- "type": "tag",
147
- "slug": "rumors",
148
- "name": "Rumors",
149
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_433,t_mp_quality,w_580/-b44f55e3-0f23-4192-bf77-de110b2f7f9a.gif",
150
- "subscriber_count": 178
151
- },
152
- {
153
- "id": 959395,
154
- "type": "tag",
155
- "slug": "creators",
156
- "name": "Creators",
157
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_600,t_mp_quality,w_600/-10293491-38f3-4d79-a119-1897cd86c90a.jpg",
158
- "subscriber_count": 657
159
- },
160
- {
161
- "id": 959428,
162
- "type": "tag",
163
- "slug": "news",
164
- "name": "News",
165
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_450,t_mp_quality,w_960/-e837b84b-712a-4c9a-8663-3117601c7856.jpg",
166
- "subscriber_count": 665
167
- },
168
- {
169
- "id": 960923,
170
- "type": "tag",
171
- "slug": "editorial",
172
- "name": "Editorial",
173
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_300,t_mp_quality,w_500/-daff61f2-3d14-4c50-ac51-1ece761e6c71.gif",
174
- "subscriber_count": 60
175
- },
176
- {
177
- "id": 978148,
178
- "type": "tag",
179
- "slug": "dvd-blu-ray",
180
- "name": "DVD & Blu-ray",
181
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_235,t_mp_quality,w_500/-c6dfb789-4d04-4810-a627-5cce20d77e19.gif",
182
- "subscriber_count": 27
183
- },
184
- {
185
- "id": 1070824,
186
- "type": "tag",
187
- "slug": "black-widow",
188
- "name": "Black Widow",
189
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_380,t_mp_quality,w_920/-ee6baf50-8e27-491a-b2a5-4fbea6edfa2a.jpg",
190
- "subscriber_count": 1573
191
- },
192
- {
193
- "id": 1096390,
194
- "type": "tag",
195
- "slug": "mcu",
196
- "name": "Marvel Cinematic Universe",
197
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_250,t_mp_quality,w_500/-f71691fc-3123-40ce-8b56-bc14a69f1527.gif",
198
- "subscriber_count": 2076
199
- },
200
- {
201
- "id": 1327911,
202
- "type": "tag",
203
- "slug": "plot",
204
- "name": "Plot",
205
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_463,t_mp_quality,w_850/-ee8b3c7a-6017-4208-8753-0eeee8ba2c6c.png",
206
- "subscriber_count": 3
207
- }
208
- ]
209
- }
210
-
211
-
212
- + Attributes
213
- - id: 3461151 (number, required) - Post's id
214
- - slug: `it-would-not-have-cost-marketing-any-more-money-to-add-black-widow-on` (string, required) - Url slug
215
- - title: `It would not have cost marketing any more money to add Black Widow on...` (string, required) - Title
216
- - html_body: <p>foo</p> (string, required) - Full HTML Body
217
- - total_comments_count: 0 (number, required) - Amount of comments
218
- - created_at: 2015-08-11T06:23:50.000-07:00 (string, required) - ActiveRecord creation date
219
- - questionnaire_id: null (number, optional) - Attached questionaire
220
- - template: null (string, optional) - Not sure, perhaps a legacy type?
221
- - abstract: null (string, optional) - Not used at the moment, this is from tarantula days
222
- - keywords: null (string, optional)
223
- - cover_image_url: null (string, optional)
224
- - cover_image_caption: null (string, optional)
225
- - seo_title: null (string, optional)
226
- - social_title: null (string, optional)
227
- - social_abstract: null (string, optional)
228
- - suggested_facebook_page_id: "1525889887653500" (string, optional)
229
- - comments_disabled: false (boolean, optional)
230
- - is_mobile_post: false (boolean, optional)
231
- - legacy_type: "post" (string, required)
232
- - og_image_url: "http://images-cdn.moviepilot.com/image/upload/v1431953404/pocket_post_big2_ct9cex.png" (string, required)
233
- - published_at: "2015-08-11T06:23:50.000-07:00" (string, required)
234
- - first_published_at: "2015-08-11T06:23:50.000-07:00" (string, required)
235
- - last_published_at: "2015-08-11T06:23:50.000-07:00" (string, required)
236
- - promoted: null (string, optional)
237
- - cover_video: {} (object, optional)
238
- - view_count: 0 (number, required)
239
- - comment_count: 0 (number, required)
@@ -1,139 +0,0 @@
1
- # this is an example of the Uber API
2
- # as a demonstration of an API spec in YAML
3
- swagger: '2.0'
4
- info:
5
- title: Moviepilot.com
6
- description: Edward
7
- version: "5.2.1"
8
- # the domain of the service
9
- host: api.moviepilot.com
10
- # array of all schemes that your API supports
11
- schemes:
12
- - http
13
- # will be prefixed to all paths
14
- basePath: /v4
15
- produces:
16
- - application/json
17
- paths:
18
- /posts/{id}:
19
- get:
20
- summary: Post
21
- description: |
22
- Post including author information and so forth
23
- parameters:
24
- - name: id
25
- in: path
26
- description: External id.
27
- required: true
28
- type: number
29
- format: integer
30
- tags:
31
- - Posts
32
- responses:
33
- 200:
34
- description: A post
35
- schema:
36
- type: object
37
- properties:
38
- id:
39
- type: number
40
- slug:
41
- type: string
42
- title:
43
- type: string
44
- html_body:
45
- type: string
46
- total_comments_count:
47
- type: number
48
- created_at:
49
- type: string
50
- questionnaire_id:
51
- type: number
52
- template:
53
- type: string
54
- abstract:
55
- type: string
56
- keywords:
57
- type: array
58
- items:
59
- type: string
60
- cover_image_url:
61
- type: string
62
- cover_image_caption:
63
- type: string
64
- seo_title:
65
- type: string
66
- social_title:
67
- type: string
68
- social_abstract:
69
- type: string
70
- suggested_facebook_page_id:
71
- type: string
72
- comments_disabled:
73
- type: boolean
74
- is_mobile_post:
75
- type: boolean
76
- legacy_type:
77
- type: string
78
- og_image_url:
79
- type: string
80
- published_at:
81
- type: string
82
- first_published_at:
83
- type: string
84
- last_published_at:
85
- type: string
86
- promoted:
87
- type: boolean
88
- cover_video:
89
- type: string
90
- view_count:
91
- type: number
92
- comment_count:
93
- type: number
94
- author:
95
- type: object
96
- in_reply_to:
97
- type: object
98
- properties:
99
- id:
100
- type: number
101
- type:
102
- type: string
103
- first_published_at:
104
- type: string
105
- last_published_at:
106
- type: string
107
- slug:
108
- type: string
109
- title:
110
- type: string
111
- author:
112
- type: object
113
- properties:
114
- id:
115
- type: number
116
- name:
117
- type: string
118
- user_name:
119
- type: string
120
- related_objects:
121
- type: array
122
- items:
123
- properties:
124
- id:
125
- type: number
126
- type:
127
- type: string
128
- slug:
129
- type: string
130
- name:
131
- type: string
132
- image_url:
133
- type: string
134
- subscriber_count:
135
- type: number
136
- required:
137
- - id
138
- - title
139
- - html_body
@@ -1,14 +0,0 @@
1
- FORMAT: 1A
2
- HOST: http://api.moviepilot.com/
3
-
4
- # Edward
5
-
6
- # Status [/v2]
7
-
8
- ## GET
9
-
10
- + Response 200 (application/json)
11
- + Body
12
- + Attributes
13
- - name: Mila (string, required) - Given name
14
- - email: hello@max-and-mila.com (string, optional) - User's email
@@ -1,239 +0,0 @@
1
- FORMAT: 1A
2
- HOST: http://api.moviepilot.com/
3
-
4
- # Edward
5
-
6
- # Status [/v2]
7
-
8
- We'll forward you to the v2 status resource
9
-
10
- ## Retrieve the Entry Point [GET]
11
-
12
- + Response 200 (application/json; charset=utf-8)
13
- + Body
14
- + Attributes
15
- - version: 5.2.1 (string, required) - Version number of currently deployed Edward
16
- - server_time: `2015-08-11T08:19:41.556-07:00` (string, required) - Server's time
17
- - user_id: 888448 (number, optional) - Requesting user's id
18
-
19
- ## Group Posts
20
-
21
- Resources related to posts in the API.
22
-
23
- ## Post [/v4/posts/{id}]
24
-
25
- + Parameters
26
- + id: `3461151` (number, required) - External id
27
-
28
- ### View a post [GET]
29
-
30
- + Response 200 (application/json; charset=utf-8)
31
-
32
- + Body
33
-
34
- {
35
- "id": 3461151,
36
- "slug": "it-would-not-have-cost-marketing-any-more-money-to-add-black-widow-on",
37
- "title": "It would not have cost marketing any more money to add Black Widow on...",
38
- "html_body": "<p>... the cover (or Hawkeye, for that matter). And would it not have been better to take the chance at one more sale by having her on than to lose a sale by not having her on?And don't say that the main characters would then have been smaller because they could have placed Black Widow to the left and behind or above the main characters without changing their relative size.</p>",
39
- "total_comments_count": 0,
40
- "created_at": "2015-08-11T06:23:50.000-07:00",
41
- "questionnaire_id": null,
42
- "template": null,
43
- "abstract": null,
44
- "keywords": null,
45
- "cover_image_url": null,
46
- "cover_image_caption": null,
47
- "seo_title": null,
48
- "social_title": null,
49
- "social_abstract": null,
50
- "suggested_facebook_page_id": "1525889887653500",
51
- "comments_disabled": false,
52
- "is_mobile_post": false,
53
- "legacy_type": "post",
54
- "og_image_url": "http://images-cdn.moviepilot.com/image/upload/v1431953404/pocket_post_big2_ct9cex.png",
55
- "published_at": "2015-08-11T06:23:50.000-07:00",
56
- "first_published_at": "2015-08-11T06:23:50.000-07:00",
57
- "last_published_at": "2015-08-11T06:23:50.000-07:00",
58
- "promoted": null,
59
- "cover_video": {},
60
- "view_count": 0,
61
- "comment_count": 0,
62
- "author": {
63
- "id": 1394326,
64
- "name": "Richard Lemay",
65
- "first_name": "Richard",
66
- "last_name": "Lemay",
67
- "user_name": null,
68
- "image_url": "https://graph.facebook.com/695180451/picture",
69
- "description": null,
70
- "followers_count": 1,
71
- "verified": "contributor",
72
- "user_subscription_count": 3,
73
- "weekly_readers": 0,
74
- "contributions_count": 1,
75
- "contribution_view_count": 0,
76
- "contribution_comments_count": 0,
77
- "facebook_id": "695180451",
78
- "twitter_handle": null,
79
- "location": null,
80
- "avatar_image_url": null,
81
- "cover_image_url": null,
82
- "provider_image_url": "https://graph.facebook.com/695180451/picture",
83
- "flags": [],
84
- "roles": [
85
- "contributor"
86
- ],
87
- "profile_public": true,
88
- "auto_promote_posts": true
89
- },
90
- "in_reply_to": {
91
- "id": 3457913,
92
- "type": "post",
93
- "first_published_at": "2015-08-10T07:02:09.000-07:00",
94
- "last_published_at": "2015-08-10T07:17:08.000-07:00",
95
- "slug": "black-widow-was-just-snubbed-by-marvel-again",
96
- "title": "Black Widow Was Just Snubbed by Marvel...AGAIN",
97
- "author": {
98
- "id": 1311215,
99
- "name": "Kit Simpson Browne",
100
- "user_name": "Kitsb"
101
- }
102
- },
103
- "related_objects": [
104
- {
105
- "id": 205406,
106
- "type": "tag",
107
- "slug": "superheroes",
108
- "name": "Superheroes",
109
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_237,t_mp_quality,w_600/-14cf0c53-33e1-41be-abb6-4490542ec6db.gif",
110
- "subscriber_count": 45802
111
- },
112
- {
113
- "id": 932254,
114
- "type": "tag",
115
- "slug": "marvel",
116
- "name": "Marvel",
117
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_211,t_mp_quality,w_500/-76cc31d4-897f-486c-9dbb-8e22fd30cf1b.gif",
118
- "subscriber_count": 8627
119
- },
120
- {
121
- "id": 958506,
122
- "type": "tag",
123
- "slug": "casting",
124
- "name": "Casting",
125
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_400,t_mp_quality,w_960/-364bed3a-81c7-4e44-8735-3500b536e23d.jpg",
126
- "subscriber_count": 668
127
- },
128
- {
129
- "id": 958518,
130
- "type": "tag",
131
- "slug": "opinion",
132
- "name": "Opinion",
133
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_205,t_mp_quality,w_400/-f08c141c-387b-4dc2-a399-8aadd4084155.gif",
134
- "subscriber_count": 236
135
- },
136
- {
137
- "id": 958527,
138
- "type": "tag",
139
- "slug": "industry",
140
- "name": "Industry",
141
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_235,t_mp_quality,w_416/-71298c11-8adb-4db0-8375-7d921f732dc2.gif",
142
- "subscriber_count": 9
143
- },
144
- {
145
- "id": 958545,
146
- "type": "tag",
147
- "slug": "rumors",
148
- "name": "Rumors",
149
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_433,t_mp_quality,w_580/-b44f55e3-0f23-4192-bf77-de110b2f7f9a.gif",
150
- "subscriber_count": 178
151
- },
152
- {
153
- "id": 959395,
154
- "type": "tag",
155
- "slug": "creators",
156
- "name": "Creators",
157
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_600,t_mp_quality,w_600/-10293491-38f3-4d79-a119-1897cd86c90a.jpg",
158
- "subscriber_count": 657
159
- },
160
- {
161
- "id": 959428,
162
- "type": "tag",
163
- "slug": "news",
164
- "name": "News",
165
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_450,t_mp_quality,w_960/-e837b84b-712a-4c9a-8663-3117601c7856.jpg",
166
- "subscriber_count": 665
167
- },
168
- {
169
- "id": 960923,
170
- "type": "tag",
171
- "slug": "editorial",
172
- "name": "Editorial",
173
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_300,t_mp_quality,w_500/-daff61f2-3d14-4c50-ac51-1ece761e6c71.gif",
174
- "subscriber_count": 60
175
- },
176
- {
177
- "id": 978148,
178
- "type": "tag",
179
- "slug": "dvd-blu-ray",
180
- "name": "DVD & Blu-ray",
181
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_235,t_mp_quality,w_500/-c6dfb789-4d04-4810-a627-5cce20d77e19.gif",
182
- "subscriber_count": 27
183
- },
184
- {
185
- "id": 1070824,
186
- "type": "tag",
187
- "slug": "black-widow",
188
- "name": "Black Widow",
189
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_380,t_mp_quality,w_920/-ee6baf50-8e27-491a-b2a5-4fbea6edfa2a.jpg",
190
- "subscriber_count": 1573
191
- },
192
- {
193
- "id": 1096390,
194
- "type": "tag",
195
- "slug": "mcu",
196
- "name": "Marvel Cinematic Universe",
197
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_250,t_mp_quality,w_500/-f71691fc-3123-40ce-8b56-bc14a69f1527.gif",
198
- "subscriber_count": 2076
199
- },
200
- {
201
- "id": 1327911,
202
- "type": "tag",
203
- "slug": "plot",
204
- "name": "Plot",
205
- "image_url": "http://images-cdn.moviepilot.com/image/upload/c_fill,h_463,t_mp_quality,w_850/-ee8b3c7a-6017-4208-8753-0eeee8ba2c6c.png",
206
- "subscriber_count": 3
207
- }
208
- ]
209
- }
210
-
211
-
212
- + Attributes
213
- - id: 3461151 (number, required) - Post's id
214
- - slug: `it-would-not-have-cost-marketing-any-more-money-to-add-black-widow-on` (string, required) - Url slug
215
- - title: `It would not have cost marketing any more money to add Black Widow on...` (string, required) - Title
216
- - html_body: <p>foo</p> (string, required) - Full HTML Body
217
- - total_comments_count: 0 (number, required) - Amount of comments
218
- - created_at: 2015-08-11T06:23:50.000-07:00 (string, required) - ActiveRecord creation date
219
- - questionnaire_id: null (number, optional) - Attached questionaire
220
- - template: null (string, optional) - Not sure, perhaps a legacy type?
221
- - abstract: null (string, optional) - Not used at the moment, this is from tarantula days
222
- - keywords: null (string, optional)
223
- - cover_image_url: null (string, optional)
224
- - cover_image_caption: null (string, optional)
225
- - seo_title: null (string, optional)
226
- - social_title: null (string, optional)
227
- - social_abstract: null (string, optional)
228
- - suggested_facebook_page_id: "1525889887653500" (string, optional)
229
- - comments_disabled: false (boolean, optional)
230
- - is_mobile_post: false (boolean, optional)
231
- - legacy_type: "post" (string, required)
232
- - og_image_url: "http://images-cdn.moviepilot.com/image/upload/v1431953404/pocket_post_big2_ct9cex.png" (string, required)
233
- - published_at: "2015-08-11T06:23:50.000-07:00" (string, required)
234
- - first_published_at: "2015-08-11T06:23:50.000-07:00" (string, required)
235
- - last_published_at: "2015-08-11T06:23:50.000-07:00" (string, required)
236
- - promoted: null (string, optional)
237
- - cover_video: {} (object, optional)
238
- - view_count: 0 (number, required)
239
- - comment_count: 0 (number, required)
@@ -1,27 +0,0 @@
1
- - id: 3461151 (number, required) - Post's id
2
- - slug: `it-would-not-have-cost-marketing-any-more-money-to-add-black-widow-on` (string, required) - Url slug fro mtitle
3
- - title: `It would not have cost marketing any more money to add Black Widow on...` (string, required) - Post's Title
4
- - html_body: <p>foo</p> (string, required) - Full HTML body of the post
5
- - total_comments_count: 0
6
- - created_at: "2015-08-11T06:23:50.000-07:00"
7
- - questionnaire_id: null
8
- - template: null
9
- - abstract: null
10
- - keywords: null
11
- - cover_image_url: null
12
- - cover_image_caption: null
13
- - seo_title: null
14
- - social_title: null
15
- - social_abstract: null
16
- - suggested_facebook_page_id: "1525889887653500"
17
- - comments_disabled: false
18
- - is_mobile_post: false
19
- - legacy_type: "post"
20
- - og_image_url: "http://images-cdn.moviepilot.com/image/upload/v1431953404/pocket_post_big2_ct9cex.png"
21
- - published_at: "2015-08-11T06:23:50.000-07:00"
22
- - first_published_at: "2015-08-11T06:23:50.000-07:00"
23
- - last_published_at: "2015-08-11T06:23:50.000-07:00"
24
- - promoted: null
25
- - cover_video: {}
26
- - view_count: 0
27
- - comment_count: 0