OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 587 forks source link

Start publishing the configuration schema for each Open Liberty release in Maven Central #25808

Open cherylking opened 1 year ago

cherylking commented 1 year ago

Describe the use case that you want to enable: Start publishing the configuration schema for each Open Liberty release in Maven Central.

Describe why this is important to you: Currently, any tool that wants to validate Liberty server configuration files must first generate the configuration schema from the installed Liberty runtime using "bin/tools/ws-schemagen.jar". This affects Liberty Tools for Eclipse/VS Code/IntelliJ. Publishing the configuration schema file would provide an easier way for the tools to validate Liberty configuration.

Additional context Liberty Tools already uses the published features-<version>.json from Maven Central to validate the feature list. This seems like a logical addition to that. I propose that Liberty generate and publish the configuration schema for each openliberty-runtime artifact since it includes configuration elements for all the features.

Additionally, it would be helpful if the configuration schema for each supported language were published. Otherwise, Liberty Tools will still need to generate its own configuration schema if the end user is running the IDE in a language other than English.

cherylking commented 1 year ago

Additional note: Recently discovered that WDT specifies the --outputVersion=2 and --schemaVersion=1.1 options when it generates the schema to validate server.xml. The documentation for those options indicate it allows for unknown elements at the expense of losing validation for known elements. If it is decided that the schema should be published, then need to also decide whether these options should be specified.

I understand that those options provide flexibility, but I don't understand which validation we lose in the process? The doc is here.

cherylking commented 1 year ago

Summary of today's discussion:

  1. Agreed to pursue publishing the schema in English for the openliberty-runtime for each upcoming release. Would need the --schemaVersion=1.1 and --outputVersion=3 that was discussed in issue #25579.
  2. Discussed publishing to DHE instead of Maven Central since the latter is more for Java libraries.
  3. Potentially could have the schema available for reference on openliberty.io, similar to how other xsd's are hosted (Jakarta related xsds on jakarta.ee).
  4. Publishing in other languages/locales can be revisited in the future once Liberty Tools supports other languages.

@cbridgha Please let me know if I mischaracterized anything. Thanks.

cbridgha commented 1 year ago

Thanks @cherylking One additional comment... This is being proposed for openliberty-runtime package only at this time, we could look at generating it for the zos-all package on the commercial side in the future. Also, if additional features not included in the cached schema are included in the local installation via user features or stack products, the tools would revert to local generation