-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datetime and dateOnly types should be mapped to TypeScript Dat #72
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ package io.vrap.rmf.codegen.types | |
|
||
import com.google.inject.Inject | ||
import com.google.inject.name.Named | ||
import io.vrap.rmf.codegen.di.VrapConstants | ||
import io.vrap.rmf.raml.model.modules.Library | ||
import io.vrap.rmf.raml.model.resources.Method | ||
import io.vrap.rmf.raml.model.resources.Resource | ||
|
@@ -67,11 +66,11 @@ class PackageProvider @Inject constructor( | |
|
||
private inner class ResourcePackageSwitch : ResourcesSwitch<String>() { | ||
override fun caseMethod(`object`: Method): String { | ||
return "$clientPackage.resource" | ||
return "$clientPackage" | ||
} | ||
|
||
override fun caseResource(`object`: Resource?): String { | ||
return "$clientPackage.resource" | ||
return "$clientPackage" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change was required because it broke our current code, don't know why we added this in the first place. |
||
} | ||
|
||
override fun defaultCase(`object`: EObject): String { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ object TypeScriptBaseTypes : LanguageBaseTypes( | |
doubleType = nativeTypeScriptType("number"), | ||
stringType = nativeTypeScriptType("string"), | ||
booleanType = nativeTypeScriptType("boolean"), | ||
dateTimeType = nativeTypeScriptType("string"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one wouldn't work since the string date is interpreted as string so trying to call a date method will induce type error. |
||
dateOnlyType = nativeTypeScriptType("string"), | ||
dateTimeType = nativeTypeScriptType("Date"), | ||
dateOnlyType = nativeTypeScriptType("Date"), | ||
timeOnlyType = nativeTypeScriptType("string") | ||
) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was required because it broke our current code, don't know why we added this in the first place.