Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed recursion in letter model #378

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
463 changes: 265 additions & 198 deletions dist/lob-api-bundled.yml

Large diffs are not rendered by default.

966 changes: 463 additions & 503 deletions dist/lob-api-postman.json

Large diffs are not rendered by default.

59 changes: 19 additions & 40 deletions docs/index.html

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions resources/letters/attributes/custom_envelope.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ returned:
type: string
description: The url of the envelope asset used.
object:
allOf:
- $ref: "../../../shared/attributes/object.yml"
- type: string
enum:
- envelope
default: envelope
type: string
enum:
- envelope
default: envelope
nullable: true
43 changes: 42 additions & 1 deletion resources/letters/models/certified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ allOf:
required:
- extra_service
- tracking_events
- color

properties:
extra_service:
Expand Down Expand Up @@ -34,5 +35,45 @@ allOf:
return_address:
$ref: "../attributes/return_address.yml"

- $ref: "letter_base.yml"

description:
$ref: "../../../shared/attributes/resource_description.yml"

metadata:
$ref: "../../../shared/models/metadata.yml"

merge_variables:
$ref: "../../../shared/models/merge_variables.yml"

send_date:
$ref: "../../../shared/attributes/send_date.yml"

mail_type:
$ref: "../../../shared/attributes/mail_type.yml"

color:
$ref: "../attributes/color.yml"

double_sided:
$ref: "../attributes/double_sided.yml"

address_placement:
$ref: "../attributes/address_placement.yml"

return_envelope:
$ref: "../attributes/return_envelope.yml#/returned"

perforated_page:
type: integer
description: >-
Required if `return_envelope` is `true`. The number of the page that should be
perforated for use with the return envelope. Must be greater than or equal
to `1`. The blank page added by `address_placement=insert_blank_page` will be
ignored when considering the perforated page number. To see how
perforation will impact your letter design, view our <a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_perf_template.pdf" target="_blank">perforation guide</a>.
nullable: true

custom_envelope:
$ref: "../attributes/custom_envelope.yml#/returned"

- $ref: "letter_generated_base.yml"
15 changes: 9 additions & 6 deletions resources/letters/models/letter.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
oneOf:
- title: certified
$ref: "certified.yml"
- allOf:
- title: regular
- $ref: "no_extra_service.yml"

- title: registered
$ref: "registered.yml"
- allOf:
- title: registered
- $ref: "registered.yml"

- title: regular
$ref: "no_extra_service.yml"
- allOf:
- title: certified
- $ref: "certified.yml"
36 changes: 0 additions & 36 deletions resources/letters/models/letter_base.yml

This file was deleted.

45 changes: 44 additions & 1 deletion resources/letters/models/no_extra_service.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
allOf:
- type: object

required:
- color


properties:
tracking_events:
description: An array of tracking events ordered by ascending `time`.
Expand All @@ -17,6 +21,45 @@ allOf:

return_address:
$ref: "../attributes/return_address.yml"

description:
$ref: "../../../shared/attributes/resource_description.yml"

metadata:
$ref: "../../../shared/models/metadata.yml"

merge_variables:
$ref: "../../../shared/models/merge_variables.yml"

send_date:
$ref: "../../../shared/attributes/send_date.yml"

mail_type:
$ref: "../../../shared/attributes/mail_type.yml"

color:
$ref: "../attributes/color.yml"

double_sided:
$ref: "../attributes/double_sided.yml"

address_placement:
$ref: "../attributes/address_placement.yml"

return_envelope:
$ref: "../attributes/return_envelope.yml#/returned"

perforated_page:
type: integer
description: >-
Required if `return_envelope` is `true`. The number of the page that should be
perforated for use with the return envelope. Must be greater than or equal
to `1`. The blank page added by `address_placement=insert_blank_page` will be
ignored when considering the perforated page number. To see how
perforation will impact your letter design, view our <a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_perf_template.pdf" target="_blank">perforation guide</a>.
nullable: true

custom_envelope:
$ref: "../attributes/custom_envelope.yml#/returned"

- $ref: "letter_base.yml"
- $ref: "letter_generated_base.yml"
43 changes: 42 additions & 1 deletion resources/letters/models/registered.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ allOf:

required:
- extra_service
- color

properties:
extra_service:
Expand Down Expand Up @@ -31,5 +32,45 @@ allOf:
return_address:
$ref: "../attributes/return_address.yml"

- $ref: "letter_base.yml"

description:
$ref: "../../../shared/attributes/resource_description.yml"

metadata:
$ref: "../../../shared/models/metadata.yml"

merge_variables:
$ref: "../../../shared/models/merge_variables.yml"

send_date:
$ref: "../../../shared/attributes/send_date.yml"

mail_type:
$ref: "../../../shared/attributes/mail_type.yml"

color:
$ref: "../attributes/color.yml"

double_sided:
$ref: "../attributes/double_sided.yml"

address_placement:
$ref: "../attributes/address_placement.yml"

return_envelope:
$ref: "../attributes/return_envelope.yml#/returned"

perforated_page:
type: integer
description: >-
Required if `return_envelope` is `true`. The number of the page that should be
perforated for use with the return envelope. Must be greater than or equal
to `1`. The blank page added by `address_placement=insert_blank_page` will be
ignored when considering the perforated page number. To see how
perforation will impact your letter design, view our <a href="https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_perf_template.pdf" target="_blank">perforation guide</a>.
nullable: true

custom_envelope:
$ref: "../attributes/custom_envelope.yml#/returned"

- $ref: "letter_generated_base.yml"