Skip to content

Note single project req. in common pitfalls #1676

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

bjornharrtell
Copy link
Contributor

Might be worth mentioning that source code generation doesn't work if the code is split out into separate project, as noted in #1511.

Comment on lines +146 to +149

#### Source generation features doesn't work on code in separated projects

See https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1511.
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the suggestion. This is already documented at https://www.jsonapi.net/usage/extensibility/controllers.html#auto-generated-controllers, which we should link to. Please move this topic after "Do not use [ApiController] on JSON:API controllers".

Suggested header name:

Don't use auto-generated controllers with shared models

Suggested text:

When model classes are defined in a separate project, the controllers are generated in that project as well, which is probably not what you want. For details, see [here](~/usage/extensibility/controllers.html#auto-generated-controllers).

@bkoelman
Copy link
Member

The master branch now contains a fix for the broken build, please merge or rebase this PR on top of that.

@bkoelman
Copy link
Member

Superseded by #1679.

@bkoelman bkoelman closed this Feb 15, 2025
@bjornharrtell
Copy link
Contributor Author

Thanks @bkoelman 🙂

@bjornharrtell bjornharrtell deleted the patch-1 branch February 15, 2025 10:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants