Comments (12)
Thanks a lot, nilportugues!
from katharsis-framework.
From @woonsan on March 29, 2016 13:10
I'm very willing to put that in katharsis-project if accepted. :-) Actually my goal was to make it working with basic features at least and propose it to katharsis. But unfortunately, I couldn't find enough time to make it for some other work to do. Its status is just an initial experiment at the moment.
Anyway, I guess we have another volunteer at least to make it work. So, I'm very willing to work with you guys and if you guys like it, I can transfer it to katharsis-project, too.
from katharsis-framework.
From @keithdmoore on March 29, 2016 13:19
There is also this placeholder project. https://github.com/meshuga/katharsis-springfox
from katharsis-framework.
Personally I have nothing against it, but as far as I know @ieugen has still some work to do with katharsis-vertex and we are gonna need maintainer for this repo... Can we handle that?
from katharsis-framework.
From @ieugen on March 29, 2016 15:15
@masterspambot The idea behind a community is to give authority. .
If we have an open process of how people can contribute then things can move with minimal intervention.
Regarding my work on katharsis-vertx: I can allready publish to jcenter. I'm going to sync with Maven tomorrow. Other then that, most of the features are ok.
@keithdmoore : what about springfox? it seems empty.
from katharsis-framework.
related topics:
OAI/OpenAPI-Specification#476
OAI/OpenAPI-Specification#519
from katharsis-framework.
As of now, I recommend to do this by adding an Interface to the "Repository" class.
The implemented interface can hold the Annotations for Swagger and the documentation can be generated.
I have done this with spring-boot and springfox. No problems at all.
from katharsis-framework.
Hi nilportugues,
It would be great, if you can provide a sample.
Thanks!
Chary
from katharsis-framework.
@charybr sure can.
In your pom.xml 's dependencies:
<!-- SWAGGER -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-core</artifactId>
<version>${swagger-core-version}</version>
</dependency>
Then, let's say you have a controller... for instance:
import io.katharsis.repository.annotations.*;
import io.katharsis.response.JsonApiResponse;
import io.swagger.annotations.ApiParam;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PathVariable;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
@Named
@JsonApiResourceRepository(Message.class)
public class MessageController implements IMessageController{
@JsonApiDelete
public void delete(@PathVariable("id") @ApiParam(value = "Message Id") String id) throws Exception {
messageDeleterService.delete(id);
}
}
Notice the IMessageController, this is it's implementation:
import io.katharsis.response.JsonApiResponse;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import springfox.documentation.annotations.ApiIgnore;
@Controller
public interface IMessageController {
@ApiResponses({
@ApiResponse(code = 204, message = "No Content"),
@ApiResponse(code = 404, message = "Not Found"),
})
@ApiOperation(
value = "Delete a Message.",
nickname = "deleter",
tags = {"API Message"}
)
@RequestMapping(
path = "api/messages/{id}", //THIS NEEDS TO MATCH WHAT KATHARSIS GENERATES.
method= RequestMethod.DELETE,
produces = "application/vnd.api+json"
)
void delete(@PathVariable("id") @ApiParam(value = "Message Id") String id) throws Exception;
}
You won't get the models in Swagger for POST, PUT or PATCH. But you'll get very basic Swagger going on.
from katharsis-framework.
We need to roll in SOME kinda support for a UI. I am in favor of this
from katharsis-framework.
I have been looking at this and I don't see a clear means of doing this. I checked out what meshuga had done and, no surprise, there is no root resource to discover. So, when you hit /
you get a 500 error. I posted about this a while ago. I will continue to investigate now that I have some time but the lack of a root issue will likely be a show stopper
from katharsis-framework.
After careful deliberation, the counsel of elders has decreed that this shall not be supported. We believe in hypermedia. It's our belief that swagger cannot support the level of functionality as described in JSON API.
Thanks for your cooperation,
The Management.
from katharsis-framework.
Related Issues (20)
- when patch relationship with empty list, class BraveRepositoryFilter throw exception. HOT 1
- example for Katharsis 3.x for jersey
- Client/Server content type management incoherent and not compliant with JSON API spec HOT 3
- Homepage links to GitHub show 404 HOT 1
- Implementation of Resource.equals() completely ignores id and type
- spring boot example could not find class “io.katharsis.validation.ValidationModule” and “io.katharsis.brave.BraveModule” HOT 1
- Katharsis client: Ability to add custom exception mapper
- @JsonIgnore not working properly in hierarchies HOT 1
- serialization of float value adds many decimal places HOT 4
- Katharsis client expects content-type exactly equal to "application/vnd.api+json", but server appends "charset=utf-8"
- Unable to add ExceptionMappers with Katharsis-cdi HOT 1
- a problem we have when updating the version of Katharsis from 2.8.2 to 3.0.2
- No support for "https" in self links possible if Katharsis runs behind a reverse proxy
- io.katharsis.utils.parser.TypeParser.addParser
- Getting Started - dropwizard-simple-example can't find resource - broken links HOT 2
- If I wanted to *just* use this for serialization/deserialization, how would I do that? HOT 2
- Add save/delete implementations for many resources HOT 4
- Kathrasis is not extendable
- Katharsis + SpringBoot + Postgresql
- Make clear that this project is dead! HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from katharsis-framework.