Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
replace deprecated
  • Loading branch information
hauner committed Mar 15, 2020
commit 265deceac2d23e993f076e97409fec3151e53f7c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Interface {
}

String getInterfaceName() {
Identifier.toClass (name) + "Api"
!name.isEmpty () ? Identifier.toClass (name) + "Api" : "Api"
}

String toString () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ class ApiWriter {

Formatter formatter

ApiWriter (ApiOptions options,
InterfaceWriter interfaceWriter,
DataTypeWriter dataTypeWriter,
StringEnumWriter enumWriter,
boolean enableFormatter = true) {
ApiWriter (
ApiOptions options,
InterfaceWriter interfaceWriter,
DataTypeWriter dataTypeWriter,
StringEnumWriter enumWriter,
boolean enableFormatter = true) {
this.options = options
this.interfaceWriter = interfaceWriter
this.dataTypeWriter = dataTypeWriter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.github.hauner.openapi.spring.model.EndpointResponse
import com.github.hauner.openapi.spring.model.RequestBody
import com.github.hauner.openapi.spring.model.parameters.Parameter
import com.github.hauner.openapi.support.Identifier
import com.github.hauner.openapi.support.IdentifierKt

/**
* Writer for Java interface methods, i.e. endpoints.
Expand Down Expand Up @@ -106,7 +105,7 @@ class MethodWriter {

private String createMethodName (Endpoint endpoint, EndpointResponse endpointResponse) {
if (endpoint.operationId != null) {
return IdentifierKt.toCamelCase (endpoint.operationId)
return Identifier.toCamelCase (endpoint.operationId)
}

def tokens = endpoint.path.tokenize ('/')
Expand Down
141 changes: 0 additions & 141 deletions src/main/groovy/com/github/hauner/openapi/support/Identifier.groovy

This file was deleted.

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

//@file:JvmName("Identifiers")
@file:JvmName("Identifier")

package com.github.hauner.openapi.support

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class IdentifierSpec extends Specification {
@Unroll
void "convert source string '#src' to valid identifiers: #identifier/#clazz/#enumn" () {
expect:
IdentifierKt.toCamelCase (src) == identifier
IdentifierKt.toClass (src) == clazz
IdentifierKt.toEnum (src) == enumn
Identifier.toCamelCase (src) == identifier
Identifier.toClass (src) == clazz
Identifier.toEnum (src) == enumn

where:
src | identifier | clazz | enumn
Expand Down