Skip to content

Commit

Permalink
fix: subid in query param
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayg10 committed Nov 12, 2024
1 parent c85cf2c commit fc8677b
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 148 deletions.
12 changes: 12 additions & 0 deletions src/interface/api-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ paths:
parameters:
#Headers
- $ref: '../../node_modules/@mojaloop/api-snippets/fspiop/v1_1/openapi3/components/parameters/Accept.yaml'
- $ref: '#/components/parameters/partySubIdOrType'
responses:
200:
description: OK
Expand Down Expand Up @@ -475,6 +476,17 @@ tags:
servers:
- url: /
components:
parameters:
partySubIdOrType:
name: partySubIdOrType
in: query
required: false
schema:
type: string
description: >-
A sub-identifier of the party identifier, or a sub-type of the party
identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
schemas:
ParticipantsTypeIDPutRequest:
title: ParticipantsTypeIDPutRequest
Expand Down
304 changes: 157 additions & 147 deletions src/interface/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ paths:
operationId: ParticipantsByTypeAndIDGet
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/partySubIdOrType'
responses:
'200':
description: OK
Expand Down Expand Up @@ -518,6 +519,162 @@ tags:
servers:
- url: /
components:
parameters:
partySubIdOrType:
name: partySubIdOrType
in: query
required: false
schema:
type: string
description: >-
A sub-identifier of the party identifier, or a sub-type of the party
identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
Type:
name: Type
in: path
required: true
schema:
type: string
description: The type of the party identifier. For example, `MSISDN`, `PERSONAL_ID`.
ID:
name: ID
in: path
required: true
schema:
type: string
description: The identifier value.
Content-Type:
name: Content-Type
in: header
schema:
type: string
required: true
description: >-
The `Content-Type` header indicates the specific version of the API used
to send the payload body.
Date:
name: Date
in: header
schema:
type: string
required: true
description: The `Date` header field indicates the date when the request was sent.
X-Forwarded-For:
name: X-Forwarded-For
in: header
schema:
type: string
required: false
description: >-
The `X-Forwarded-For` header field is an unofficially accepted standard
used for informational purposes of the originating client IP address, as
a request might pass multiple proxies, firewalls, and so on. Multiple
`X-Forwarded-For` values should be expected and supported by
implementers of the API.
**Note:** An alternative to `X-Forwarded-For` is defined in [RFC
7239](https://tools.ietf.org/html/rfc7239). However, to this point RFC
7239 is less-used and supported than `X-Forwarded-For`.
FSPIOP-Source:
name: FSPIOP-Source
in: header
schema:
type: string
required: true
description: >-
The `FSPIOP-Source` header field is a non-HTTP standard field used by
the API for identifying the sender of the HTTP request. The field should
be set by the original sender of the request. Required for routing and
signature verification (see header field `FSPIOP-Signature`).
FSPIOP-Destination:
name: FSPIOP-Destination
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-Destination` header field is a non-HTTP standard field used
by the API for HTTP header based routing of requests and responses to
the destination. The field must be set by the original sender of the
request if the destination is known (valid for all services except GET
/parties) so that any entities between the client and the server do not
need to parse the payload for routing purposes. If the destination is
not known (valid for service GET /parties), the field should be left
empty.
FSPIOP-Encryption:
name: FSPIOP-Encryption
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-Encryption` header field is a non-HTTP standard field used
by the API for applying end-to-end encryption of the request.
FSPIOP-Signature:
name: FSPIOP-Signature
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-Signature` header field is a non-HTTP standard field used by
the API for applying an end-to-end request signature.
FSPIOP-URI:
name: FSPIOP-URI
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-URI` header field is a non-HTTP standard field used by the
API for signature verification, should contain the service URI. Required
if signature verification is used, for more information, see [the API
Signature
document](https://github.com/mojaloop/docs/tree/main/Specification%20Document%20Set).
FSPIOP-HTTP-Method:
name: FSPIOP-HTTP-Method
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-HTTP-Method` header field is a non-HTTP standard field used
by the API for signature verification, should contain the service HTTP
method. Required if signature verification is used, for more
information, see [the API Signature
document](https://github.com/mojaloop/docs/tree/main/Specification%20Document%20Set).
Accept:
name: Accept
in: header
required: true
schema:
type: string
description: >-
The `Accept` header field indicates the version of the API the client
would like the server to use.
Content-Length:
name: Content-Length
in: header
required: false
schema:
type: integer
description: >-
The `Content-Length` header field indicates the anticipated size of the
payload body. Only sent if there is a body.
**Note:** The API supports a maximum size of 5242880 bytes (5
Megabytes).
SubId:
name: SubId
in: path
required: true
schema:
type: string
description: >-
A sub-identifier of the party identifier, or a sub-type of the party
identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
schemas:
ParticipantsTypeIDPutRequest:
title: ParticipantsTypeIDPutRequest
Expand Down Expand Up @@ -1142,150 +1299,3 @@ components:
description: >-
The `Content-Type` header indicates the specific version of the API used
to send the payload body.
parameters:
Type:
name: Type
in: path
required: true
schema:
type: string
description: The type of the party identifier. For example, `MSISDN`, `PERSONAL_ID`.
ID:
name: ID
in: path
required: true
schema:
type: string
description: The identifier value.
Content-Type:
name: Content-Type
in: header
schema:
type: string
required: true
description: >-
The `Content-Type` header indicates the specific version of the API used
to send the payload body.
Date:
name: Date
in: header
schema:
type: string
required: true
description: The `Date` header field indicates the date when the request was sent.
X-Forwarded-For:
name: X-Forwarded-For
in: header
schema:
type: string
required: false
description: >-
The `X-Forwarded-For` header field is an unofficially accepted standard
used for informational purposes of the originating client IP address, as
a request might pass multiple proxies, firewalls, and so on. Multiple
`X-Forwarded-For` values should be expected and supported by
implementers of the API.
**Note:** An alternative to `X-Forwarded-For` is defined in [RFC
7239](https://tools.ietf.org/html/rfc7239). However, to this point RFC
7239 is less-used and supported than `X-Forwarded-For`.
FSPIOP-Source:
name: FSPIOP-Source
in: header
schema:
type: string
required: true
description: >-
The `FSPIOP-Source` header field is a non-HTTP standard field used by
the API for identifying the sender of the HTTP request. The field should
be set by the original sender of the request. Required for routing and
signature verification (see header field `FSPIOP-Signature`).
FSPIOP-Destination:
name: FSPIOP-Destination
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-Destination` header field is a non-HTTP standard field used
by the API for HTTP header based routing of requests and responses to
the destination. The field must be set by the original sender of the
request if the destination is known (valid for all services except GET
/parties) so that any entities between the client and the server do not
need to parse the payload for routing purposes. If the destination is
not known (valid for service GET /parties), the field should be left
empty.
FSPIOP-Encryption:
name: FSPIOP-Encryption
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-Encryption` header field is a non-HTTP standard field used
by the API for applying end-to-end encryption of the request.
FSPIOP-Signature:
name: FSPIOP-Signature
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-Signature` header field is a non-HTTP standard field used by
the API for applying an end-to-end request signature.
FSPIOP-URI:
name: FSPIOP-URI
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-URI` header field is a non-HTTP standard field used by the
API for signature verification, should contain the service URI. Required
if signature verification is used, for more information, see [the API
Signature
document](https://github.com/mojaloop/docs/tree/main/Specification%20Document%20Set).
FSPIOP-HTTP-Method:
name: FSPIOP-HTTP-Method
in: header
schema:
type: string
required: false
description: >-
The `FSPIOP-HTTP-Method` header field is a non-HTTP standard field used
by the API for signature verification, should contain the service HTTP
method. Required if signature verification is used, for more
information, see [the API Signature
document](https://github.com/mojaloop/docs/tree/main/Specification%20Document%20Set).
Accept:
name: Accept
in: header
required: true
schema:
type: string
description: >-
The `Accept` header field indicates the version of the API the client
would like the server to use.
Content-Length:
name: Content-Length
in: header
required: false
schema:
type: integer
description: >-
The `Content-Length` header field indicates the anticipated size of the
payload body. Only sent if there is a body.
**Note:** The API supports a maximum size of 5242880 bytes (5
Megabytes).
SubId:
name: SubId
in: path
required: true
schema:
type: string
description: >-
A sub-identifier of the party identifier, or a sub-type of the party
identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
3 changes: 2 additions & 1 deletion src/server/handlers/participants/{Type}/{ID}.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export async function get(_context: Context, request: Request, h: ResponseToolki
}

const partyId = request.params.ID
const partyMapItem = await retrievePartyMapItem(partyId)
const subId = request.query?.partySubIdOrType
const partyMapItem = await retrievePartyMapItem(partyId, subId)
return h.response({ partyList: [partyMapItem] }).code(200)
}

Expand Down

0 comments on commit fc8677b

Please sign in to comment.