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

chore: Add regex pattern for receiver #174

Merged
merged 5 commits into from
Sep 20, 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
24 changes: 19 additions & 5 deletions auth-server-open-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -566,16 +566,13 @@ components:
type: object
properties:
receiver:
type: string
format: uri
description: URL for the incoming payment or ILP STREAM Connection.
$ref: '#/components/schemas/receiver'
sendAmount:
$ref: '#/components/schemas/amount'
receiveAmount:
$ref: '#/components/schemas/amount'
interval:
type: string
description: '[ISO8601 repeating interval](https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals)'
$ref: '#/components/schemas/interval'
anyOf:
- not:
required:
Expand Down Expand Up @@ -605,6 +602,23 @@ components:
- value
- assetCode
- assetScale
interval:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that include examples, too?

title: Interval
type: string
description: '[ISO8601 repeating interval](https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals)'
examples:
- 'R11/2022-08-24T14:15:22Z/P1M'
- 'R/2017-03-01T13:00:00Z/2018-05-11T15:30:00Z'
- 'R-1/P1Y2M10DT2H30M/2022-05-11T15:30:00Z'
receiver:
title: Receiver
type: string
description: The URL of the incoming payment or ILP STREAM connection that is being paid.
format: uri
pattern: "^https:\/\/(.+)\/(incoming-payments|connections)\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
examples:
- 'https://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c'
- 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8'
client:
title: client
type: object
Expand Down
25 changes: 15 additions & 10 deletions open-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ paths:
examples:
New Incoming Payment for $25:
value:
id: 'http://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c'
id: 'https://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c'
paymentPointer: 'https://openpayments.guide/alice/'
incomingAmount:
value: '2500'
Expand Down Expand Up @@ -429,7 +429,7 @@ paths:
- id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c'
paymentPointer: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/shoeshop/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
sendAmount:
value: '7026'
assetCode: USD
Expand Down Expand Up @@ -457,7 +457,7 @@ paths:
- id: 'https://openpayments.guide/alice/outgoing-payments/0cffa5a4-58fd-4cc8-8e01-7145c72bf07c'
paymentPointer: 'https://openpayments.guide/alice/'
failed: false
receiver: 'https://openpayments.guide/shoeshop/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
receiver: 'https://openpayments.guide/shoeshop/incoming-payments/2fe92c6f-ef0d-487c-8759-3784eae6bce9'
sendAmount:
value: '7026'
assetCode: USD
Expand Down Expand Up @@ -564,9 +564,7 @@ paths:
type: object
properties:
receiver:
type: string
format: uri
description: The URL of the incoming payment or ILP STREAM connection that is being paid.
$ref: '#/components/schemas/receiver'
receiveAmount:
$ref: '#/components/schemas/amount'
sendAmount:
Expand Down Expand Up @@ -1060,9 +1058,8 @@ components:
description: Describes whether the payment failed to send its full amount.
default: false
receiver:
type: string
format: uri
description: The URL of the incoming payment or ILP STREAM Connection that is being paid.
$ref: '#/components/schemas/receiver'
receiveAmount:
description: The total amount that should be received by the receiver when this outgoing payment has been paid.
$ref: '#/components/schemas/amount'
Expand Down Expand Up @@ -1139,9 +1136,8 @@ components:
description: The URL of the payment pointer from which this quote's payment would be sent.
readOnly: true
receiver:
type: string
format: uri
description: The URL of the incoming payment or ILP Stream Connection that would be paid.
$ref: '#/components/schemas/receiver'
receiveAmount:
description: The total amount that should be received by the receiver.
$ref: '#/components/schemas/amount'
Expand Down Expand Up @@ -1211,6 +1207,15 @@ components:
minimum: 0
maximum: 255
description: The scale of amounts denoted in the corresponding asset code.
receiver:
title: Receiver
type: string
description: The URL of the incoming payment or ILP STREAM connection that is being paid.
format: uri
pattern: '^https://(.+)/(incoming-payments|connections)/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'
examples:
- 'https://openpayments.guide/alice/incoming-payments/08394f02-7b7b-45e2-b645-51d04e7c330c'
- 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8'
pagination:
description: Pagination parameters
oneOf:
Expand Down