geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
426 stars 489 forks source link

OpenAPI not displaying Multipart file parameter #5842

Open josegar74 opened 3 years ago

josegar74 commented 3 years ago

Describe the bug Add page API (http://localhost:8080/geonetwork/doc/api/index.html#/pages/addPage) doesn't show the data parameter:

https://github.com/geonetwork/core-geonetwork/blob/57a963d64262eb9625f04bae0247ab6cec799078/services/src/main/java/org/fao/geonet/api/pages/PagesAPI.java#L78-L96

To Reproduce Steps to reproduce the behavior:

  1. Login as Administrator
  2. Go to the API page: http://localhost:8080/geonetwork/doc/api/index.html#/pages/addPage
  3. No entry for the parameter data

Expected behavior There is an entry for the parameter data as in previous versions.

Screenshots

Version 4.0

version4

Version 3.12

version312


Seem related to https://github.com/swagger-api/swagger-ui/issues/3784, but the issue is closed without clarifying any reason.

In https://stackoverflow.com/questions/48607100/file-upload-on-swagger-editor-openapi-3-not-showing-the-file-browser-when-trying points to:

Swagger Editor 3.5.7 and Swagger UI 3.16.0

@fxprunayre do you know which version of these components are used in GeoNetwork? Related to the Swagger UI, I just see this folder: https://github.com/geonetwork/core-geonetwork/tree/main/web/src/main/webapp/doc/api

But it's unclear the version used, checking in the javascript file I see this .exports={version:"2.6.5"}, but not sure if that refers to the version of Swagger UI.

Is there any documentation to update Swagger UI and related components if required?

ianwallen commented 3 years ago

@josegar74,

Looks like GN is currently using spingdocs 1.5.9 (which seems to be the latest version at the moment)

https://github.com/geonetwork/core-geonetwork/blob/57a963d64262eb9625f04bae0247ab6cec799078/pom.xml#L1511

And according to the dependencies it seems to use Swagger UI version 3.49.0

https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui/1.5.9

josegar74 commented 3 years ago

Ok, "supposedly" according to https://stackoverflow.com/questions/48607100/file-upload-on-swagger-editor-openapi-3-not-showing-the-file-browser-when-trying that should work since Swagger UI 3.16.0.

But seem GeoNetwork has a "manual" copy of the Swagger UI files in https://github.com/geonetwork/core-geonetwork/tree/main/web/src/main/webapp/doc/api, I don't have clear if that matches the version of the springdoc dependency. Not clear either why these files should be added manually to GeoNetwork.