Skip to content

[Request]: Documentation plugin fails to auto-detect custom fields in users-permissions register endpoint #2874

Description

@murschiid

Summary

The Strapi documentation plugin does not automatically detect custom fields added to the users-permissions User content-type, forcing developers to use redundant manual overrides.

Why is it needed?

I'm always frustrated when I properly extend the User content-type with custom fields and configure the users-permissions plugin, but the documentation completely ignores these fields. This creates a broken developer experience where:

API works - custom fields are accepted in actual requests

Documentation lies - Swagger UI shows incomplete/inaccurate API specs

Forces workarounds - developers must manually override documentation with mutateDocumentation

Maintenance nightmare - fields are defined in multiple places (schema + documentation override)

This defeats the purpose of having auto-generated documentation and creates inconsistency between the actual API behavior and its documentation.

Suggested solution(s)

The documentation plugin should automatically detect and include custom fields from:

User content-type schema extensions (src/extensions/users-permissions/content-types/user/schema.json)

users-permissions plugin configuration (allowedFields in plugin config)

Expected behavior:

When I add firstName and lastName to User schema as required fields

And configure allowedFields: ['firstName', 'lastName']

The /auth/local/register endpoint documentation should automatically show all 5 required fields (username, email, password, firstName, lastName)

Current broken behavior:

Only shows default fields (username, email, password)

Forces manual documentation overrides

The fix should ensure that any fields properly configured for registration automatically appear in the generated OpenAPI documentation without manual intervention.

Related issue(s)/PR(s)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions