lburgazzoli / syndesis-extension-example-xml

Apache License 2.0
0 stars 1 forks source link

syndesis-extension-definition.json is not schema valid: missing 'version, 'name', 'description', 'extensionId' #7

Open apupier opened 6 years ago

apupier commented 6 years ago

When validating the syndesis-extension-definition.json file with the schema https://github.com/syndesisio/syndesis/blob/master/app/rest/model/src/main/resources/syndesis/syndesis-extension-definition-schema.json it complains about missing attributes: 'version, 'name', 'description', 'extensionId'

Is it that the schema need to be updated? or is it that the file needs to be updated?

nicolaferraro commented 6 years ago

We can remove the "required" constraints on that schema fields if you need to validate incomplete fragments. Wdyt?

apupier commented 6 years ago

We can remove the "required" constraints on that schema fields if you need to validate incomplete fragments. Wdyt?

why do you say they are "incomplete"? They are complete "definition"/"design time". I wasn't part of the discussions leading to put some values in pom.xml and not in json file. I don't know what is the best.

lburgazzoli commented 6 years ago

I think there is a little confusion here: if you want the freedom to manipulate the whole extension definition, you should disable plugin's metadata generation so you can safely add name, description and so on to the definition and run your validation stuffs against it. If you enable plugin's metadata generation, the bits found in META-INF/syndesis/syndesis-extension-definition.json are used as template and enriched with plugin's findings.

If needed we can support taking 'version, 'name', 'description', 'extensionId' from the template, if you need so please raise an issue on syndesis.

lhein commented 6 years ago

Proposed solution: When tooling creates a project we will pre-fill the json with extensionId, Name, Description and version. That way the schema validation is no longer blocked by these values missing. We will not specify the configuration items for the maven plugin. The maven plugin itself then needs to check each of these values if its specified in the maven plugin config section or not. If its not specified then it should not touch the values in the json if its already defined.