Skip to content

Commit

Permalink
[scala-akka-http] fixed getOffsetDateTimeHeader and removed broken te…
Browse files Browse the repository at this point in the history
…st due invalid v2 spec (OpenAPITools#6109)
  • Loading branch information
chameleon82 authored and michaelpro1 committed May 7, 2020
1 parent 3156f5d commit a9b6a73
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package {{mainPackage}}.core

import java.io.File
import java.net.URLEncoder
import java.time.OffsetDateTime

import scala.util.Try

Expand All @@ -26,6 +27,8 @@ sealed trait ApiReturnWithHeaders {
def getBooleanHeader(name: String): Option[Boolean] = castedHeader(name, java.lang.Boolean.parseBoolean)
def getOffsetDateTimeHeader(name: String): Option[OffsetDateTime] = castedHeader(name, java.time.OffsetDateTime.parse)
private def castedHeader[U](name: String, conversion: String => U): Option[U] = {
Try {
header(name).map(conversion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package org.openapitools.client.core

import java.io.File
import java.net.URLEncoder
import java.time.OffsetDateTime

import scala.util.Try

Expand All @@ -36,6 +37,8 @@ sealed trait ApiReturnWithHeaders {

def getBooleanHeader(name: String): Option[Boolean] = castedHeader(name, java.lang.Boolean.parseBoolean)

def getOffsetDateTimeHeader(name: String): Option[OffsetDateTime] = castedHeader(name, java.time.OffsetDateTime.parse)

private def castedHeader[U](name: String, conversion: String => U): Option[U] = {
Try {
header(name).map(conversion)
Expand Down
121 changes: 0 additions & 121 deletions samples/client/petstore/scala-akka/src/test/scala/PetApiTest.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package org.openapitools.client.core

import java.io.File
import java.net.URLEncoder
import java.time.OffsetDateTime

import scala.util.Try

Expand All @@ -36,6 +37,8 @@ sealed trait ApiReturnWithHeaders {

def getBooleanHeader(name: String): Option[Boolean] = castedHeader(name, java.lang.Boolean.parseBoolean)

def getOffsetDateTimeHeader(name: String): Option[OffsetDateTime] = castedHeader(name, java.time.OffsetDateTime.parse)

private def castedHeader[U](name: String, conversion: String => U): Option[U] = {
Try {
header(name).map(conversion)
Expand Down

0 comments on commit a9b6a73

Please sign in to comment.