syndesisio / syndesis

A flexible, customizable, open source platform that provides core integration capabilities as a service.
https://syndesis.io/
Apache License 2.0
592 stars 205 forks source link

Describe Data - Implement specify root element control in form #1878

Open gashcrumb opened 6 years ago

gashcrumb commented 6 years ago

This is a...


[ x ] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Documentation issue or request

The problem

In the describe data design there's a control the user can use to indicate the root element of the document they're submitting. I guess this would be most useful if the user is submitting a schema document, and the actual type they want to use is in that document.

Screenshot

This control is present in many of the screenshots, labeled Specify Root Element -> https://github.com/syndesisio/syndesis/blob/master/ux/designs/describe-data/img/describe-data-define-urlerror.png

API Endpoints and Schemas

TBD

Tasks involved / Steps to Reproduce

First off we need to identify if this is something that can be done in the UI or if we'll need backend support. The frontend could for example use a library to help with the XML parsing etc. however there's likely going to be issues with large files. It may be better to implement a backend service to provide possible document roots for XML and JSON schema and instance documents. Once that's figured out we can update this area with a more defined list of tasks

Follow on from #1229

igarashitm commented 6 years ago

If I understand correctly, this ambiguity is only in XML Schema, as JSON always have an unnamed root bracket.

gashcrumb commented 6 years ago

Makes sense, so this field only needs to be present when one of the XML kinds is selected.

igarashitm commented 6 years ago

I think even XML instance document doesn't have this ambiguity as XML document only allows single root element. If the user-provided XML instance document contains multiple root elements, that is invalid XML document and should end up with validation error. It's XML Schema doesn't define a root element in itself.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

dhirajsb commented 4 years ago

If I understand atlasmap schemasets correctly, we can solve this by creating a schemaset with a chameleon (no namespace) root schema, that just has an element with an element ref/type reference to the real schema in additionalSchemas.

dhirajsb commented 4 years ago

At least that's how I intend to solve this problem for the SOAP Connector issue #6504.

igarashitm commented 4 years ago

That "creating chameleon schema" could be a workaround that user can do manually. This issue is to assist choosing a root element from UI instead. Generic XML schema can have multiple top elements defined in each schema, therefore atlasmap can't determine which one to be used for data shape. WSDL defines which is the element to be used in itself, so SOAP doesn't hit this problem.

igarashitm commented 4 years ago

Syndesis UI code can specify root element name as a part of data shape initialization parameter DocumentInitializationModel https://github.com/atlasmap/atlasmap/pull/362/files#diff-881a05f693105e2d79919cd3a45b3e5aR164

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!