-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support for Primitive (simple) types in Definitions in Swagger Doc #14
Comments
A better approach would be to use a newtype.
…On Fri, Feb 22, 2019, 7:43 PM Kahlil Abreu ***@***.***> wrote:
The code is written in such a way that we expect the definitions of data
in the Definitions HashMap to be complex Arrays/Objects.
Consider the following Definition entry in the swagger Doc :
CustomRoleKeyOrId:
description: The 20-hexdigit id or the key for a custom role.
example: revenue-team
type: string
For this we should probably create a type alias
type CustomRoleKeyOrId = Text
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZvNUVeRceVpVMAS7fCq2elNkVq6fWtks5vP_r5gaJpZM4bJrTE>
.
|
@ersran9 Okay.
Or alternatively, when processing the final |
Only difference between both would be that in the first approach - had
someone defined a data type with legitimately one field it will get
elaborated as a data X = .. vs newtype X in the second method. But I think
legitimate cases of custom data types with one field could be just a
newtype and second approach sounds a lot simpler.
…On Fri, Feb 22, 2019, 7:57 PM Kahlil Abreu ***@***.***> wrote:
@ersran9 <https://github.com/ersran9> Okay.
I was thinking of extending the current type we store in the State
It is currently
data CreateNewType = SumType String [String] [String] | ProductType NewData
data NewData = NewData
{
mName :: String
, mRecordTypes :: InnerRecords
}
Or alternatively, when processing the final State value and generating
the types, I could add a check for ProductTypes (if they have only record
entry in the list then make a newtype instead of data ...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABZvNaTvSbxtUNXanzzEWkfJvZfxLczFks5vP_5igaJpZM4bJrTE>
.
|
The So I think what is remaining for this ticket to be solved is to implement the check when parsing the |
As per the discussion today with @ersran9
In the future, the ideal thing to do would be to generate it as If it's possible (not too expensive and quick), while implementing, we can directly implement the For now we can use the |
The code is written in such a way that we expect the definitions of data in the Definitions HashMap to be complex Arrays/Objects.
Consider the following Definition entry in the swagger Doc :
For this we should probably create a type alias
type CustomRoleKeyOrId = Text
The text was updated successfully, but these errors were encountered: