Skip to content

Releases: manusant/spark-swagger

v2.0.8

09 Dec 11:53
Compare
Choose a tag to compare

Improvements handling configurations:
Fixes #47

v2.0.7

09 Dec 11:52
Compare
Choose a tag to compare

Fix issues

2.0.6

13 Aug 00:11
Compare
Choose a tag to compare

Fix issue #30

2.0.5

12 Aug 23:25
Compare
Choose a tag to compare
  1. Fixed dependencies
  2. Improve security implementation. Add support for Basic Auth, API Key and OAuth
  3. Add support for Header parameter
  4. Add support for Cookie parameter
  5. Add support for Form parameter

2.0.4

12 Aug 21:06
Compare
Choose a tag to compare

Update dependencies

2.0.3

12 Aug 20:42
Compare
Choose a tag to compare
  1. Expose security definition / schema
  2. Update dependencies

2.0.2

10 Dec 18:55
Compare
Choose a tag to compare

Changeset

  1. Add Spark-Swagger Options configuration object as a builder.
Service spark = Service.ignite()
        .ipAddress("localhost")
        .port(8081);

Options.builder()
      .confPath(SparkSwagger.CONF_FILE_NAME)
      .version("1.0.0")
      .enableCors(true)
      .enableStaticMapping(true)
      .build();

SparkSwagger.of(spark, options)
        .endpoints(() -> Arrays.asList(new HammerEndpoint(), new ShieldEndpoint()))
        .generateDoc();
  1. Adapt Route interface to have Route and TypedRoute components
.get(path()
            .withDescription("Gets the available shields")
            .withResponseAsCollection(Shield.class), new Route() {
              @Override
              public Object onRequest(Request request, Response response) {
        
                  Shield shield = Shield.builder()
                          .id("sh_123456")
                          .name("Thor Main Shield")
                          .owner("Manuel Santos")
                          .defense(10)
                          .build();
        
                  return ok(response, Arrays.asList(shield));
              }
    })

or 

.post(path("/:id")
              .withDescription("Get Shield by ID")
              .withRequestType(BackupRequest.class)
              .withResponseType(Shield.class), new TypedRoute<BackupRequest>() {

                  @Override
                  public Object onRequest(BackupRequest body, Request request, Response response) {
                      return badRequest(response, "Invalid shield ID");
                  }
      })
  1. Fix issue with path definitions and conflict between swagger spec and actual route path
  2. Include @content annotation as a way to specify content type, marshaling and unmarshaling
.post(path("/backup")
                .withDescription("Trigger Network Backup")
                .withRequestType(BackupRequest.class)
                .withGenericResponse(),
                new TypedRoute<BackupRequest>() {
        
                    @Content(ContentType.APPLICATION_JSON)
                    public Object onRequest(BackupRequest body, Request request, Response response) {
                        return badRequest(response, "Backup Name required in order to backup Network Data");
                    }
        })
  1. Fix swagger specification for responseAsCollection
  2. Add option for responseAsMap
.get(path("/options")
            .withDescription("Gets all shield options")
            .withResponseAsMap(Shield.class), new Route() {
              @Override
              public Object onRequest(Request request, Response response) {
      
                  Map<String, Shield> shields = new HashMap<>();
      
                  Shield thor = Shield.builder()
                          .id("sh_123456")
                          .name("Thor Shield")
                          .owner("Manuel Santos")
                          .defense(50)
                          .build();
                  shields.put("thor",thor);
      
                  Shield loki = Shield.builder()
                          .id("sh_255678")
                          .name("Loki Shield")
                          .owner("Manuel Santos")
                          .defense(20)
                          .build();
                  shields.put("loki",loki);
      
                  return ok(response, shields);
              }
    })
  1. Fix issue supplying version config
  2. Include static mapping enable config
  3. Add option to load UI resources from project resources besides from artifact jar, locally (for testing purpose)

1.0.0.49

25 Apr 14:13
1a86f20
Compare
Choose a tag to compare

First NEXUS release

1.0.0.48

24 Apr 21:19
1bcd9cd
Compare
Choose a tag to compare
Merge pull request #3 from Seabath/master

removal of / at the end of path of size 1

1.0.0.47

28 May 15:06
Compare
Choose a tag to compare
Remove Spark typify extension to a new library