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 591 forks source link

Incorrect substitution values in OpenAPI message #29876

Open Azquelt opened 1 week ago

Azquelt commented 1 week ago

Need to check whether the OPENAPI_MERGE_INVALID_NAME_CWWKO1666W can be used for both MP Config properties and server.xml element names.

The message is only written to accept an MP Config property name.

benjamin-confino commented 1 day ago

Are you asking if OPEN_API_SLASH_IN_APPLICATION_CWWKO1678W and OPEN_API_SLASH_IN_MODULE_CWWKO1679W can be removed and OPENAPI_MERGE_INVALID_NAME_CWWKO1666W used in their place?

Azquelt commented 1 day ago

No, I'm asking if OPENAPI_MERGE_INVALID_NAME_CWWKO1666W is the correct message in each code path where it's used.

I guess there are two questions to answer

  1. Is the message specific to MP Config?
  2. Is there a code path where we emit this message due to a problem with config from the server.xml?

If the answer to both is "yes" then we may need to reword the message, or create a new message for the server.xml path.

benjamin-confino commented 1 day ago

The answer is that we do put app/module names from server.xml into the code that emits OPENAPI_MERGE_INVALID_NAME_CWWKO1666W but as written the regex will accept literally any string except an empty one.

After discussion on slack we're going to only make a minimal change to ensure we don't break any old apps.