-
-
Notifications
You must be signed in to change notification settings - Fork 158
PrimaryResourceType not to be null at this point #1285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The stable version of JsonApiDotNetCore does not work with Swagger/OpenAPI. Did you try this on the |
I completely removed Swagger/OpenAPI from application. Still the same error. Here is my startup code now:
Controllers and model are the same. |
I got your sample code working after I removed the following line: app.MapControllers(); The bare minimum is described at: https://www.jsonapi.net/getting-started/step-by-step.html#add-services-and-middleware. If you then get an error about multiple controllers found, make sure that your RestaurantsController is in exactly the same namespace as the auto-generated one. You can remove the Also, you can leave out the |
Thank you. It's working now 😊
…On Sat, Jun 24, 2023 at 1:23 AM Bart Koelman ***@***.***> wrote:
I got your sample code working after I removed the following line:
app.MapControllers();
The bare minimum is described at:
https://www.jsonapi.net/getting-started/step-by-step.html#add-services-and-middleware
.
If you then get an error about multiple controllers found, make sure that
your RestaurantsController is in exactly the same namespace as the
auto-generated one. You can remove the [Route("[controller]")] line.
Also, you can leave out the PublicName = "..." entries, the casing
convention is automatically applied.
—
Reply to this email directly, view it on GitHub
<#1285 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6PQNL67EHV6AG7BZ56JVE3XMYQPXANCNFSM6AAAAAAZRSO6SI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*The content of this email is confidential and intended for the recipient
specified in message only. It is strictly forbidden to share any part of
this message with any third party, without a written consent of the sender.
If you received this message by mistake, please reply to this message and
follow with its deletion, so that we can ensure such a mistake does not
occur in the future.
Any quotations sent are only to be used to compare
available offers and do not imply entering into a legally binding agreement
unless sent explicitly in the form of a legally binding contract.*
|
SUMMARY
I tried to make very basic working sample of JSONAPI rest service. I followed instructions in building sample. I can run the sample and it shows swagger documentation. However when I try to call a method get on my controller (using Postman, or Swagger) I get following error:
DETAILS
I have a Reastaurant object like this:
I have Dish object as this:
My restaurant controller looks like this:
and Dish controller same.
That is it. Plus this is startup code:
VERSIONS USED
The text was updated successfully, but these errors were encountered: