Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import jakarta.transaction.Transactional;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.Context;
Expand Down Expand Up @@ -137,6 +138,24 @@ public TableItem<ContainerCountVo> findAll(@Context final UriInfo uriInfo) {
});
}

/**
* Create the given company. Concrete re-declaration of the inherited
* {@code @POST create(V)} from {@link AbstractContainerResource} so JAX-RS
* registers the route on the concrete bean — the parent annotation isn't
* picked up because of type erasure on the generic parameter V.
*
* <p>Produces {@code text/plain} (not the class-level JSON default): the
* returned identifier is a raw string, not a JSON document, so clients can
* read it via {@code response.text()} instead of failing to parse an
* unquoted scalar as JSON.
*/
@POST
@Produces(MediaType.TEXT_PLAIN)
@Override
public String create(final ContainerEditionVo container) {
return super.create(container);
}

@Override
protected void checkForDeletion(final ContainerOrg container) {
super.checkForDeletion(container);
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/ligoj/app/plugin/id/resource/GroupResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@ public boolean exists(@PathParam(GROUP_ATTRIBUTE) final String group) {
return findById(group) != null;
}

/**
* Create the given group. Concrete re-declaration of the inherited
* {@code @POST create(V)} from {@link AbstractContainerResource} so JAX-RS
* registers the route on the concrete bean — the parent annotation isn't
* picked up because of type erasure on the generic parameter V.
*
* <p>Produces {@code text/plain} (not the class-level JSON default): the
* returned identifier is a raw string, not a JSON document, so clients can
* read it via {@code response.text()} instead of failing to parse an
* unquoted scalar as JSON.
*/
@POST
@Produces(MediaType.TEXT_PLAIN)
@Override
public String create(final GroupEditionVo container) {
return super.create(container);
}

@Override
protected String toDn(final GroupEditionVo container, final ContainerScope scope) {
var parentDn = scope.getDn();
Expand Down
Loading