-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Expose the Delivery API CLR type #15150
Expose the Delivery API CLR type #15150
Conversation
Hi there @vsilvar, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
And, thank you for this one too! 💯 Someone on the core collabs team will review this soon. |
74412a1
to
b12e608
Compare
Hi @vsilvar - thanks a lot for this. It looks great! As you mention there is a little issue with breakage on the public I'll give it a spin in the coming days 😄 |
src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Core/Models/PublishedContent/IPublishedPropertyType.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi again @vsilvar,
This looks good 👍 I have left a few comments and a means to keep this from breaking the interface.
Hi @kjac As for the default implementation to avoid the breaking change, I've initially refrained from doing so, as we can't implement it with a correct behavior. Any class that implements EDIT: All comments should be addressed now, let me know if I missed any |
Hi @vsilvar, Thanks a lot for the updates. I'll get on them soon 😄 The default implementations at interface level is indeed less discoverable than the alternative, but we can't break things at interface level for a minor. The only alternative is to target V13 for this PR, and I believe you'd like this for V12? |
Hi @kjac, I'll leave that up to you, and already made a separate commit for the default interface implementation so it's easy to revert if we do target v13. |
It's all good @vsilvar ... it's fine to include in V12, might come in handy for some. V13 introduces another new property on the interface for explicit cache levels during property expansion, and that is also implemented as non-breaking in the same fashion: https://github.com/umbraco/Umbraco-CMS/blob/release/13.0/src/Umbraco.Core/Models/PublishedContent/IPublishedPropertyType.cs#L63 I'm fighting the build pipelines with this one. Soon as they stop acting up, I'll be able to give this a spin. |
@vsilvar the builds are being a bit on the annoying side today. Could I ask you to please update your fork and merge the contrib branch into this PR? |
@kjac Sounds good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and tests out great too 😍
Good stuff @vsilvar 🥳 I'll cherry-pick this to V13 in the hopes it'll make it into 13.0. We don't know yet when the next V12 will be out, but by then this will be there too 😄 |
* Expose the Delivery API CLR type * Updated field naming and warnings Addresses PR feedback * Added default implementation to prevent breaking change (cherry picked from commit 7f43780)
Cherry-picked in a4b4107 |
Sounds great, thanks @kjac! |
Prerequisites
Currently it's not possible to determine the delivery API type of a property without the use of reflection.
The use case for such a feature is to transform the swagger so it returns the proper document types response models, similar to Umbraco's models builder.
(You can check it here: https://github.com/ByteCrumb/Umbraco.Community.DeliveryApiExtensions)
Example of the code that is currently necessary:
This PR exposes the necessary properties.
It's technically a breaking change as a property was added to
IPublishedPropertyType
.