Skip to content

Comments

feat: Generate MyAccount API assets#650

Open
agiannelli-auth0 wants to merge 9 commits intomainfrom
feat/DM-289
Open

feat: Generate MyAccount API assets#650
agiannelli-auth0 wants to merge 9 commits intomainfrom
feat/DM-289

Conversation

@agiannelli-auth0
Copy link
Contributor

@agiannelli-auth0 agiannelli-auth0 commented Feb 19, 2026

Description

This PR begins the process of implementing MyAccount API in Mintlify.

Changes:

  • Updated script to:
  • First run of the script to generate MyAccount API pages

References

https://auth0team.atlassian.net/browse/DM-289

Testing

Video of local MyAccount API running

Screen.Recording.2026-02-20.at.2.15.27.PM.mov

Video of MyAccount API proxied through docs-backend with docs_explorer_mintlify_myaccount_enabled FF on and off. Flag is initially off and you see the v1 experience. With the flag on, you see the v2 experience
NOTE: This video was take prior to some additional work on the MyAccount pages themselves. Reference video above for latest look & feel.

Screen.Recording.2026-02-19.at.4.34.28.PM.mov

Checklist

  • I've read and followed CONTRIBUTING.md.
  • I've tested the site build for this change locally.
  • I've made appropriate docs updates for any code or config changes.
  • I've coordinated with the Product Docs and/or Docs Management team about non-trivial changes.

@nlucero
Copy link

nlucero commented Feb 20, 2026

⚠️ I noticed the following errors in the console, though the pages load up fine.

Screenshot 2026-02-19 at 3 44 00 PM

These are probably SSR errors. Did you check the browser console when rendering these pages? Did you see any similar errors?

@agiannelli-auth0
Copy link
Contributor Author

⚠️ I noticed the following errors in the console, though the pages load up fine.
Screenshot 2026-02-19 at 3 44 00 PM

These are probably SSR errors. Did you check the browser console when rendering these pages? Did you see any similar errors?

I see this error in the browser console:

Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

This is likely something internal to Mintlify that I will need to ask them about.

@agiannelli-auth0
Copy link
Contributor Author

@nlucero I don't know that the console errors are related to this, but I am still trying to identify a root cause and see if I can address.

@agiannelli-auth0
Copy link
Contributor Author

@nlucero I don't know that the console errors are related to this, but I am still trying to identify a root cause and see if I can address.

This issue is fixed.

const mdxContent = dedent`
---
openapi: ${file} ${method} ${path}
openapi: ${method} ${path}
Copy link

Choose a reason for hiding this comment

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

Question: This doesn't seem right. According to their docs:

If you have multiple OpenAPI specifications, include the file path in your reference.

Since we will eventually have multiple OASs, shouldn't we be explicit here and set the file property as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't believe this is an issue when you declare the OAS files in docs.json (ref)

Locally I added a second My Account API + a sample Petstore API, generated the files, and things worked as expected.

Copy link

@nlucero nlucero Feb 24, 2026

Choose a reason for hiding this comment

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

Will this also work with different localized versions of the same schema? E.g. when viewing a MyAccount endpoint page in fr-ca, it should read from main/docs/oas/myaccount/myaccount-api-oas.fr-ca.json.

Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: Please revert this change. The openapi property needs three values for the scenario we are creating for ourselves. We need file, method, and path

(see prev comment - ref)

return docsJson;
}

async function getOasFilePath({ locale, oasConfig }) {
Copy link

Choose a reason for hiding this comment

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

Question: Where are we using this function? I only see it imported in tests 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! This was a miss on my part when I was testing the English fallback 🙈 . This has been reimplemented!

if (locale === "en") {
return enPath;
}
const localeFilename = chain(oasConfig.outputFile)
Copy link

Choose a reason for hiding this comment

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

Nit: Add a code comment above this line with a little example of what this does, it should help when reading it.

@@ -0,0 +1,9 @@
---
openapi: post /authentication-methods/{authentication_method_id}/verify
Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: The openapi property should have three values: file, method, path. We'll need to update the generation script to add these.

"homepage": "https://github.com/auth0/docs-v2#readme",
"dependencies": {
"@a0/myaccount-api-oas": "1.404.0",
"@fern-api/auth0-myaccount-snippets": "^0.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: can you please pin this dependency

---

import { ReleaseLifecycle } from "/snippets/ApiReleaseLifecycle.jsx";
import { ReleaseLifecycle } from "/snippets/ReleaseLifecycle.jsx";
Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: The snippet should be called ApiReleaseLifecycle. Can we update the name of the file instead of changing the name here please.

const mdxContent = dedent`
---
openapi: ${file} ${method} ${path}
openapi: ${method} ${path}
Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: Please revert this change. The openapi property needs three values for the scenario we are creating for ourselves. We need file, method, and path

(see prev comment - ref)

const indexContent = dedent`
---
title: "${apiName}"
description: "${apiName} endpoints"
Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: there shouldn't be untranslated text in these templates. This value can just be passed in.

* Note: This file will be ignored if it already exists to prevent
* loss of any changes.
*/
async function writeApiIndexMdx({ docpath, apiName }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Question: How do we feel about making this more clear and creating a title, and description configuration. This way we can change the values that get passed in (for translations or otherwise).

Comment on lines +164 to +171
} catch {
// File doesn't exist, create it
try {
await fs.writeFile(indexFilePath, indexContent);
} catch (err) {
console.error(`failed to write index: ${indexFilePath}`, err);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 This can technically fail for user access reasons. What do you think about using stat instead? The only reason fs.stat throws is if the file doesn't exist.

docsJson.navigation.languages[langIdx].tabs[refIdx].dropdowns.push({
dropdown: oasConfig.docSectionNameMap[locale],
icon: "list",
openapi: specPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

✋🏽 Change Request: I think we're going to need to remove this as when this property is included the sidebar structure is not what we're expecting.

Removing this, means that we don't require specPath at multiple locations, we can probably remove the getOasFilePath function, which removes the need for patchDocsJson to be an async function.

Comment on lines +322 to +325
// and ensure the openapi field is always present
docsJson.navigation.languages[langIdx].tabs[refIdx].dropdowns[
apiIdx
].pages = [`${docsPath}/index`, docsByLocale[locale]];
].openapi = specPath;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ref previous comment - ref

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.

3 participants