Token Schemas
- 21 Nov 2022
-
DarkLight
-
PDF
Token Schemas
- Updated on 21 Nov 2022
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Token requests are a good example of a translation you may want in two schemas (request and response). For instance, you may want to require fields on the request, but those fields are not present on the response.
Notice this schema does the translation from username to user_name and password to passwd on the request, and from access_token to token on the response.
Since the response schema does not have the dynamicfields flag, the default is false – which means that the only field that will show up in the response to IAP is token.
Example: Request Token Schema
"$id": ”reqTokenSchema.json",
"type": "object",
"schema": "http://json-schema.org/draft-07/schema#",
"translate": true,
"dynamicfields": true,
"properties": {
"ph_request_type": {
"type": "string",
"description": "type of request (internal to adapter)",
"default": "getToken",
"enum": [
"getToken",
"healthcheck"
],
"external_name": "ph_request_type"
},
"username": {
"type": "string",
"description": "username to log in with",
"external_name": "user_name"
},
"password": {
"type": "string",
"description": "password to log in with",
"external_name": "passwd"
}
},
"required": ["username","password"],
"definitions": {}
Example: Response Token Schema
"$id": ”respTokenSchema.json",
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"translate": true,
"properties": {
"ph_request_type": {
"type": "string",
"description": "type of request (internal to adapter)",
"default": "getToken",
"enum": [
"getToken"
],
"external_name": "ph_request_type"
},
"token": {
"type": "string",
"description": "the token returned from system",
"external_name": "access_token"
}
},
"definitions": {}
Was this article helpful?