Skip to content

feat(DATA-3217): Docs for maadhaar - #451

Open
adit-shriyans-setu wants to merge 4 commits into
mainfrom
DATA-3217
Open

feat(DATA-3217): Docs for maadhaar#451
adit-shriyans-setu wants to merge 4 commits into
mainfrom
DATA-3217

Conversation

@adit-shriyans-setu

Copy link
Copy Markdown
Collaborator

No description provided.

@adit-shriyans-setu adit-shriyans-setu self-assigned this Jul 28, 2026
@github-actions

Copy link
Copy Markdown

Checklist to merge a PR 🚀

To merge this pull request, please take time to complete the checklist.

What action did you perform?

Review the corresponding checklist items for the action you performed and mark them done.

Edit an existing content (MDX) page

Checklist

  • Review changes using the MDX preview option
  • If the length of content >15000 chars, use the Content preview portal to view changes
  • If a redirect is needed to the existing page, add a key, value pair in redirects.json

Edit an existing API reference page

Checklist


Add a new content (MDX) page

Checklist

  • Create a .mdx file with the path as its name in the content folder
  • Add frontmatter with all the metadata
  • Review the order of items in Sidebar using the Sidebar preview option
  • Review changes using the MDX preview option
  • If the length of content >15000 chars, use the Content preview portal to view changes
  • Created a folder with the same name, if any children were to be added to the page
  • Once all changes are done, update the menu items by using the Menu Items option
  • Add a key, and value pair in redirects.json if you wish to have a redirect to the new page

Add a new API reference page

Checklist

  • Create a .json file with the product path as its name
  • Create an api-reference.mdx file in the respective product folder inside content folder
  • Add frontmatter with all the metadata
  • Review the order of items in Sidebar using the Sidebar preview option
  • Add API reference in JSON format (OpenAPI or Swagger) into created .json file.
  • Used the Content preview portal to view changes
  • Once all changes are done, update the menu items by using the Menu Items option

@hr1shabh hr1shabh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here is a detailed line-by-line review. I've uncovered some critical schema validation issues, API contradictions, and potential deep link bugs that should be addressed.

Comment thread api-references/data/maadhaar.json Outdated
"$ref": "#/components/schemas/AadhaarOutput"
},
{
"type": "null"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the WebhookResponse schema, aadhaar_output uses anyOf with {"type": "null"}. However, the document specifies "openapi": "3.0.0", and OpenAPI 3.0 does not support the null type (it was introduced in 3.1). To make this valid OpenAPI 3.0, you should remove anyOf and instead use "nullable": true alongside allOf: [{ $ref: ... }] (similar to how it's done for StatusResponse).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

made the change

Comment thread api-references/data/maadhaar.json
}
},
"WebhookResponse": {
"type": "object",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is a systemic naming inconsistency between camelCase traceId and snake_case trace_id across the API:

  • QRGenerateResponse, IntentPayloadResponse, and ErrorResponse return traceId at the root.
  • StatusResponse and WebhookResponse return trace_id at the root.
  • More confusingly, StatusResponse returns trace_id at the root, but the nested error object inside it uses traceId.

Is this intentional? Mixing casing conventions in the same API will likely cause parsing bugs for developers.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

made consistent to traceId

"type": "object",
"required": ["txn_id", "sd_jwt"],
"properties": {
"txn_id": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the /api/maadhaar/process-sd-jwt endpoint, the request body requires txn_id, but the documentation instructs the developer to "Use the original workflow_id as txn_id." If these represent the exact same value in this flow, should the API field simply be renamed to workflow_id for consistency?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

valid point, will raise with Product, but right now its txn_id in request and some clients have started using the apis so we shouldnt be changing it right now

<CodeBlockWithCopy>
{`var components = URLComponents()
components.scheme = "pehchaan"
components.host = "in.gov.uidai.pehchan"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For iOS App-to-App (and Web-to-App), the intent scheme is pehchaan (double 'a'), but the host is in.gov.uidai.pehchan (single 'a'). Meanwhile, the Android intent uses in.gov.uidai.pehchaan.INTENT_REQUEST (double 'a'). Is the single 'a' in pehchan a typo in the iOS URL host, or is it an actual inconsistency imposed by UIDAI's mobile apps?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

its intentional, the working code has the exact same intent link usage, this was provided by UIDAI

If the user aborts authentication or UIDAI returns an authentication error, the
webhook is sent with `status: "error"`, the error code and message, and no
Aadhaar output. For example, UIDAI error code `303` means that the user
aborted the authentication process:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The docs note "UIDAI error code 303 means that the user aborted". However, the HTTP API examples return text-based error codes (e.g., "INVALID_REQUEST", "NO_ERROR"). Will the API return error codes as numeric strings (e.g., "303") in some cases and text constants in others? Mixed typing here could easily break client-side switch statements.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added in description that in webhook response we'll send uidai response code which is string in data type but contains numberic data

"error": {
"code": "INVALID_REQUEST",
"detail": "List of desired Aadhaar fields",
"traceId": "2feb81d0-a84f-4885-9e3e-ba6f2946b288"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the 400 Bad Request error examples, the detail message is literally "List of desired Aadhaar fields". This reads like a property description rather than an actionable error message. Should this be updated to a more descriptive backend error like "Missing or invalid list of desired Aadhaar fields"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

changed example to a better one

"status": "success",
"trace_id": "1-68d122f6-3732177863083023409ea933",
"txn": "ca44473f-00ad-4744-a430-39b83c01cfb6",
"workflow_id": "ca44473f-00ad-4744-a430-39b83c01cfb6"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the success examples, the returned txn (UIDAI transaction identifier) exactly matches the workflow_id (a UUID generated by the merchant). Does UIDAI actually echo back the merchant's UUID as the transaction ID? If txn is generated independently by UIDAI, these examples should use different strings so developers don't falsely assume they will always match.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

no these are exactly the same for now in the current implementation, so these have to be same
there is a separate implementation (not implemented by uidai yet) where they use jti, then the txn will be different so sending txn makes sense

Comment thread docs-ingestion/src/normalize-api-specs.test.ts
@adit-shriyans-setu
adit-shriyans-setu removed the request for review from pankaj0308 July 30, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants