Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Steffen Hornbæk Nielsen 54 posts 165 karma points
    Jun 19, 2023 @ 12:55
    Steffen Hornbæk Nielsen
    0

    Will document types, be part of the schema in the new Delivery API?

    Hi all,

    Just fooled around with the new Delivery API in the current RC of V12. But when playing with the API i noticed that document types are not part of the generated schema for swagger. I was hoping they would be visible, as to use TS generator for swagger to generate my client and types, so i won't have to do it by hand.

    Does anyone know if this is a feature that might be added at some point, or am i just supposed to spend hours/days manually keeping my headless solution up to date?

  • Niels Henriksen 73 posts 276 karma points
    Jun 23, 2023 @ 06:44
    Niels Henriksen
    0

    If you look for "contentType" in the json returned by Umbraco - then you will have the documenttype that are being used for the current page.

    In "properties" is all the component you are using on the documenttype.

  • Steffen Hornbæk Nielsen 54 posts 165 karma points
    Jun 23, 2023 @ 07:25
    Steffen Hornbæk Nielsen
    0

    Thats right, but as long as contetTypes aren't a part of the schema, a TS generator for a client, wont now the types and it wont be possible to automaticly get strongly typed data.

    enter image description here

  • Niels Henriksen 73 posts 276 karma points
    Jun 23, 2023 @ 07:57
    Niels Henriksen
    0

    Ah I see... I am also looking at Umb12 with headless but I go another route with it to get more control on content and stability

  • Oliver Storm Køppen 3 posts 72 karma points
    Aug 04, 2023 @ 04:45
    Oliver Storm Køppen
    0

    Did you find a way to do this? I am waiting to use the new delivery API until this is possible. Thanks.

  • Niels Henriksen 73 posts 276 karma points
    Aug 04, 2023 @ 05:52
    Niels Henriksen
    0

    The way I do (planned) is that when a page is published I send the id of the page to an API. This API connect to Umbraco (v12) and get the json from it.

    It will be saved in a database and the client (website) connect to the API and request the page.

    In this way I can crash the Umbraco (if I want) or update it without any downtime.

  • Oliver Storm Køppen 3 posts 72 karma points
    Aug 04, 2023 @ 06:29
    Oliver Storm Køppen
    0

    This wouldn't work in our setup. Like Steffen, I need to create strongly-typed models (using OpenAPI) that can be consumed by i.e. a frontend-application. If the delivery API doesn't support this, I would probably have to do my own mappings and create custom viewmodels that will work using OpenAPI.

    It's just a bit too much double-work and I would really much want Umbraco to handle this in a nice way.

  • Niels Henriksen 73 posts 276 karma points
    Sep 30, 2023 @ 07:57
    Niels Henriksen
    0

    Sometimes you need to see Umbraco as a platform to extend and not as a system that gives everything for you :)

  • fatmazayed 41 posts 122 karma points
    Sep 30, 2023 @ 07:37
    fatmazayed
    0

    i have the same issue my document types not appeared

  • Steffen Hornbæk Nielsen 54 posts 165 karma points
    Jun 11, 2024 @ 08:35
    Steffen Hornbæk Nielsen
    0

    I have just tried this on Umbraco V13 and i can confirm that this is still an issue.

Please Sign in or register to post replies

Write your reply to:

Draft