Skip to content
This repository was archived by the owner on Mar 14, 2021. It is now read-only.

Update #2

Merged
merged 7 commits into from
Jun 29, 2020
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ generate java interfaces for the api defined in an openapi.yaml file

The purpose of the sample is to show the setup of the gradle plugin and the processors.

# Documentation
# documentation

See [here][oap-docs].

Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ plugins {
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'org.unbroken-dome.test-sets' version '2.1.1'
id "com.github.ben-manes.versions" version "0.28.0"

// add processor-gradle plugin
id 'com.github.hauner.openapi-processor' version '1.0.0.M7'
id 'com.github.hauner.openapi-processor' version '1.0.0.M8'
}

group = 'com.github.hauner'
version = '0.0.1-SNAPSHOT'
group = 'io.openapiprocessor'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
Expand Down Expand Up @@ -42,7 +43,7 @@ openapiProcessor {
// "process${name of processor}" (in this case "processSpring") to run the processor.
spring {
// the spring processor dependency
processor 'com.github.hauner.openapi:openapi-processor-spring:1.0.0.M12'
processor 'io.openapiprocessor:openapi-processor-spring:1.0.0.M15'

// setting api path inside a processor configuration overrides the one at the top.
// apiPath "${projectDir}/src/api/openapi.yaml"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Sun Dec 22 09:07:07 CET 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
4 changes: 3 additions & 1 deletion src/api/mapping.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
openapi-processor-mapping: v2

options:
# the root package of the generated interfaces/model. The package folder tree will be created
# inside {targetDir} configured in the build.gradle file. The generated interfaces and models
# will be placed into the "api" and "model" subpackages of packageName:
# - interfaces => "${packageName}.api"
# - models => "${packageName}.model"
package-name: com.github.hauner.openapi
package-name: io.openapiprocessor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.hauner.openapi;
package io.openapiprocessor;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 the original authors
* Copyright 2019-2020 the original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,9 @@
* limitations under the License.
*/

package com.github.hauner.openapi;
package io.openapiprocessor;

import com.github.hauner.openapi.api.EchoApi;
import org.springframework.http.ResponseEntity;
import io.openapiprocessor.api.EchoApi;
import org.springframework.web.bind.annotation.RestController;

/**
Expand All @@ -29,8 +28,8 @@
public class EchoController implements EchoApi {

@Override
public ResponseEntity<String> getEcho (String source) {
return ResponseEntity.ok (source);
public String getEcho (String source) {
return source;
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 the original authors
* Copyright 2019-2020 the original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,9 @@
* limitations under the License.
*/

package com.github.hauner.openapi;
package io.openapiprocessor;

import com.github.hauner.openapi.api.PingApi;
import org.springframework.http.ResponseEntity;
import io.openapiprocessor.api.PingApi;
import org.springframework.web.bind.annotation.RestController;

/**
Expand All @@ -29,8 +28,8 @@
public class PingController implements PingApi {

@Override
public ResponseEntity<String> getPing () {
return ResponseEntity.ok ("pong");
public String getPing () {
return "pong";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.github.hauner.openapi
package io.openapiprocessor

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.github.hauner.openapi
package io.openapiprocessor

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
Expand Down