graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

creation_date listed as optional for API when creating index set via POST /system/indices/index_sets

Open drewmiranda-gl opened this issue 1 year ago • 2 comments

creation_date listed as optional for API when creating index set via POST /system/indices/index_sets even though this is a required field and an error will be presented:

{"type":"ApiError","message":"Cannot construct instance of org.graylog2.rest.resources.system.indexer.responses.IndexSetSummary, problem: Null creationDate\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 25, column: 1]"}

This is similar to https://github.com/Graylog2/graylog2-server/issues/16019 .

Expected Behavior

Mandatory fields are correctly marked as mandatory. Optional are correctly marked as optional.

Current Behavior

creation_date is a mandatory field that is marked optional.

Possible Solution

Update creation_date to be required.

Steps to Reproduce (for bugs)

Context

Your Environment

  • Graylog Version: 5.1.4
  • Java Version: Bundled
  • OpenSearch Version: 2.8.0
  • MongoDB Version: 6.0.8
  • Operating System: Ubuntu Server 22.04 LTS
  • Browser version: Google Chrome Version 115.0.5790.170 (Official Build) (arm64)

drewmiranda-gl avatar Aug 08 '23 16:08 drewmiranda-gl

@drewmiranda-gl - thanks for reporting it. After the first look, it seems that we do not support it at all...

Interesting classes:

  • org.graylog.api.GenerateApiDefinition
  • org.graylog2.shared.rest.documentation.generator.Generator

Especially interesting javadoc fragment:

This is generating API information in <a href="http://swagger.io/">Swagger</a> format.

We decided to write this ourselves and not to use the Swagger JAX-RS/Jersey integration
because it was not compatible to Jersey2 at that point and just way too complicated
and too big for what we want to do with it.

If you are ok with it, I'd park it for a while and start asking architects (@bernd and @dennisoelkers ) about the strategy - do we want to fix the problem in our code-base, or do we want to change the old strategy and allow Swagger to generate API information (possibly migrate to newer Swagger as well).

luk-kaminski avatar Aug 09 '23 12:08 luk-kaminski

Hi, because this was about mandantory and optional fields, can someone please verify that the API Browser didnt show any mandantory Fields? I took some probes here and could not find one which shows the correct information of relevance of the options. I tried 4.1.13 and 5.2 Version of Graylog.

/hasturo

hasturo avatar Feb 16 '24 11:02 hasturo