[SOLVED] Regenerating JS DTOs from Management Api
# help-with-umbraco
d
Can anyone give me pointers as to where I go to regenerate the Js structures? I've made a new api in the management api, and I can see it in the swagger, but I need to regenerate the structures in the front-end project.
d
Not sure if this is what you're looking for, but if you have swagger, you can use a tool like nswag studio to generate a javascript client for you: https://learn.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-nswag?view=aspnetcore-7.0&tabs=visual-studio
d
Thanks, but not quite. In the new backoffice JS project there a bunch of autogenerated "model" files, like
/src/external/backend-api/src/models/HealthCheckModel.ts
that has:
/* generated using openapi-typescript-codegen -- do no edit */
Never mind. I found the command in the package json - I obviously missed it the first time round.
s
What's the command.. so when people find this they don't have to hunt it down? 😅
n
I'm guessing that would be
npm run generate:api