Content API & SwaggerGen
# help-with-umbraco
r
I'm setting up the new Content API with SwaggerGen in hope to strongly type the API for my TypeScript front end application. Has anyone setup SwaggerGen and if so, how have you done so? I have a really basic implementation working, see the code snippet attached, but I need a decent way of generating more complex types such as the block list model, see the other attached snippet.
s
Hey Ryan, so I just had a chat with Kenn and he says to please raise this as a feature request over here: https://github.com/umbraco/Umbraco-CMS/discussions Basically, what needs to be done to support this is that we'll need a generator like Modelsbuilder to do that for the Delivery API output. Currently none of that is available but it could be a great new feature if people need it. The advise for now is that you can get a long way with doing some of this yourself like you are doing but it would be less complicated (once your doctype/property structure is more or less settled) to do this manually. Yes, this will require manual updates from time to time but since we don't have a generator right now, it would be a lot of work to build your own generator that can catch all cases. Hope that makes sense, do please start a discussion on the link above so we can learn more about wants and needs!
r
@Sebastiaan apologies I’ve just seen this! Amazing, many thanks. I’ll raise the feature along with the basic implementation I’ve done for reference.
5 Views