My fault. It is working fine.

I assumed the doc [1] used the current demo data, but the demo data has
changed, so the layer names resolve to 'null' and then all the styles are taken
as style groups.

I suggest updating the doc, both:

- [1]: use the new API format, and
- [2]: include somewhere the 'type' attribute.

It would also help to include some WARN logging when there is non-null 'ref'
(layer name) that can't be resolved:

- 
https://github.com/geoserver/geoserver/blob/b2122ecb59a0c29932b1bbd2417b3bc72baf5e96/src/restconfig/src/main/java/org/geoserver/rest/catalog/LayerGroupController.java#L135
- 
https://github.com/geoserver/geoserver/blob/b2122ecb59a0c29932b1bbd2417b3bc72baf5e96/src/main/src/main/java/org/geoserver/catalog/impl/ResolvingProxy.java#L122

Thanks,
-Eduardo

On Wed, Apr 08, 2020 at 12:09:26AM +0100, Eduardo Suarez wrote:
> I've tried to use the geoserver API to create a LayerGroup using the example 
> in
> the documentation [1], but I'm getting an error 500.
> 
> ...
> 
> From the API documentation [2], it seems that the API has evolved, despite the
> swagger API version number seems not to be managed (1.0.0).
> 
> ...
> 
> However, with the new API it would looked like:
> 
> <layerGroup>
>   <name>nyc</name>
>   <publishables>
>     <published type="layer">
>       <name>roads</name>
>     </published>
>     <published type="layer">
>       <name>parks</name>
>     </published>
>     <published type="layer">
>       <name>buildings</name>
>     </published>
>   </layers>
>   <styles>
>     <style><name>roads_style</name></style>
>     <style><name>polygon</name></style>
>     <style><name>polygon</name></style>
>   </styles>
> </layerGroup>
> 
> ...
> 
> [1] https://docs.geoserver.org/stable/en/user/rest/layergroups.html
> 
> [2] https://docs.geoserver.org/latest/en/api/#1.0.0/layergroups.yaml
> 
> [3] https://docs.geoserver.org/stable/en/user/styling/sld/working.html

-- 
 *Eduardo Suarez-Santana*
  Departamento de Computación Científica y Tecnológica
  División de Investigación y Desarrollo Tecnológico
 *Instituto Tecnológico de Canarias*, S.A. - Gobierno de Canarias

  Direc: Playa de Pozo Izquierdo, s/n - 35119 Santa Lucía, Las Palmas
  Telef: (+34) 928.727.583         fax: (+34) 928.727.597
  email: [email protected]   url: http://www.itccanarias.org

AVISO LEGAL:
Este mensaje y los ficheros adjuntos si los hubiere, se dirigen
exclusivamente a su destinatario y puede contener información
privilegiada o confidencial. La transmisión errónea del presente mensaje
en ningún momento supone renuncia a su confidencialidad. Si no es vd. el
destinatario indicado, queda notificado de que la utilización,
divulgación y/o copia sin autorización está prohibida en virtud de la
legislación vigente. Si ha recibido este mensaje por error, le rogamos
que nos lo comunique inmediatamente por esta misma vía y proceda a su
destrucción.

LEGAL WARNING:
This message and the files attached if there were any, are intended
exclusively for its addressee and may contain information that is
CONFIDENTIAL and protected by professional privilege. A wrong
transmission to this message don’t suppose we relinquished to It’s
confidential. If you are not the intended recipient you are hereby
notified that any dissemination, copy or disclosure of this
communication is strictly prohibited by law. If this message has been
received in error, please immediately notify us via e-mail and delete it.


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to