sangeethailango

sangeethailango

The open_api API documentation library is giving "internal server error"

I am trying to create an API documentation site for my API using the open_api library in my project. However, I am encountering an “Internal Server Error.”

I have created a GitHub repo to replicate the error:
GitHub repo: https://github.com/sangeethailango/project_management

After cloning the repo, go to http://localhost:4000/api/redoc to find the page where the error occurs.

The page loads fine if I remove the related(:users, :read) line in the accounts.ex domain file. However, the page fails to load when this line is present. For your information, I did not encounter any errors while creating the APIs, but the issue only occurs here.

Marked As Solved

shankardevy

shankardevy

It looks your user resource is two things:

  1. missing json_api declaration
  json_api do
    type("user")
  end
  1. and the use of extensions: [AshJsonApi.Resource]
  use Ash.Resource,
    domain: ProjectManagement.Account,
    data_layer: AshPostgres.DataLayer,
    extensions: [AshJsonApi.Resource]

Adding both should fix the error.

Where Next?

Popular in Questions Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54921 245
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement