Skip to content

docs: fix incorrect model typedefs (AuthorizationCodeData / ClientData)#443

Merged
jankapunkt merged 2 commits into
node-oauth:masterfrom
dhensby:docs/model-typedef-fixes
Jun 16, 2026
Merged

docs: fix incorrect model typedefs (AuthorizationCodeData / ClientData)#443
jankapunkt merged 2 commits into
node-oauth:masterfrom
dhensby:docs/model-typedef-fixes

Conversation

@dhensby

@dhensby dhensby commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Documentation fixes found while investigating #409.

Closes #409.

Changes

1. Correct two model typedef descriptions (docs: fix incorrect AuthorizationCodeData and ClientData typedefs)

  • AuthorizationCodeData documented the code-string property as code, but getAuthorizationCode() returns / saveAuthorizationCode() accepts authorizationCode, and the library reads code.authorizationCode everywhere it touches it (authorize-handler.js, authorization-code-grant-type.js). Renamed codeauthorizationCode to match reality and the sibling AccessTokenData/RefreshTokenData typedefs. Thanks @omusil24 for the report.
  • ClientData.id carried a copy-pasted description ("The authorization code passed to getAuthorizationCode()"); corrected to "A unique string identifying the client".

This is documentation-only: the library reads code.authorizationCode exclusively and never reads code.code, so no runtime change or backward-compat shim is required.

2. Regenerate drifted API docs (docs: regenerate API docs to match current JSDoc)

While regenerating model.md I found several committed API docs no longer matched npm run docs:api (their JSDoc had been changed without regenerating): authorize-handler, pkce, server, authorization-code-grant-type. Regenerated so the committed docs match source again.

Notes

  • No code/behaviour change; npm run lint passes.
  • Might be worth a small CI check (docs:api + git diff --exit-code docs/api) to stop this drift recurring — happy to add in a follow-up if useful.

🤖 Generated with Claude Code

dhensby and others added 2 commits June 16, 2026 09:35
The AuthorizationCodeData typedef documented the code-string property as
`code`, but getAuthorizationCode()/saveAuthorizationCode() and the library
itself use `authorizationCode` (see authorize-handler and
authorization-code-grant-type, which read `code.authorizationCode`). Rename
the property to match reality and the other token typedefs.

ClientData.id also carried a copy-pasted description ("The authorization
code passed to getAuthorizationCode()"); correct it to describe the client
id.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Several committed API docs had drifted from their JSDoc source — their
output no longer matched `npm run docs:api`. Regenerate authorize-handler,
pkce, server and authorization-code-grant-type so the committed docs match
the source again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread docs/api/model.md
@jankapunkt jankapunkt merged commit 7cbcd0b into node-oauth:master Jun 16, 2026
4 checks passed
@dhensby dhensby deleted the docs/model-typedef-fixes branch June 16, 2026 11:04
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.

Documentation of revokeAuthorizationCode is incorrect

2 participants