-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement schema-intent concept #6001
Conversation
7370245
to
3acdec2
Compare
opengever/api/schema/vocabularies.py
Outdated
elif len(self.params) == 1: | ||
# Edit intent | ||
# - context is the object to be edited | ||
# - schemata need to be determined via context |
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.
This comment line is not needed here
opengever/api/schema/vocabularies.py
Outdated
# Add intent | ||
# - context is the container where the object will be created | ||
# - portal_type is the type of object to be created | ||
# - schemata need to be determined via portal_type |
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.
This comment line is not needed here
opengever/api/schema/vocabularies.py
Outdated
# - portal_type is the type of object to be created | ||
# - schemata need to be determined via portal_type | ||
self.intent = 'add' | ||
portal_type = self.params[0] |
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.
portal_type is unused here
91cdf30
to
63407cb
Compare
Current stand:
Then there were some issues with fields of the type type of the keywords which have one more level of nesting (
|
e7b3393
to
ca23515
Compare
|
||
@adapter(ICollection, Interface, IOpengeverBaseLayer) | ||
@implementer(IJsonSchemaProvider) | ||
class GEVERCollectionJsonSchemaProvider(CollectionJsonSchemaProvider): |
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.
😅 When I was looking at this issue I was thinking to myself I don't want to overwrite all these adapters, there must be some easier way...
.
This one is ready for a final review. We decided to not duplicate efforts for documentation, and create it when this finally moves upstream into |
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 good to me. But there is still a WIP commit message ...
opengever/api/schema/vocabularies.py
Outdated
vocab_name = self.params[0] | ||
elif len(self.params) == 2: | ||
# Add intent | ||
# - context is the container where the object will be created | ||
# - portal_type is the type of object to be created, not needed here | ||
# - first parameter is the portal_type, not needed here |
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.
not needed here
✂️ 🤔
Multivalued fields don't directly have sources themselves, but their items do. We therefore need to handle that case in the @sources and @querysources endpoints, and look for a source on the Choice field used as the value_type for the multivalued field. Similarly we need to construct appropriate URLs during schema serialization for these types of fields: The Choice fields used as the value_type for multivalued fields don't usually have a name. We therefore omit their empty string name from the URL, and instead construct URLs that look like the source was actually on the multivalued fields themselves.
ca23515
to
3c929e6
Compare
Updated |
Implements the schema-intent concept according to #5973:
@schema
endpoint@sources
,@querysources
and@vocabularies
endpointsTodo:
IDuringContentCreation
interface on the request during add-intent scenariosrestricted_vocab.py
@types
needs to be added to@schema
as well@types
responses aren't broken in non-backwards compatible ways- [ ] DocumentationObviously the frontend also needs to be adapted to use these new endpoints in their intent-aware ways.