Conversation
| if (propLines.length) lines.push(`${DOC}`) | ||
| join(lines, propLines) | ||
| lines.push(' */') | ||
| lines.push(`const ${name}=null`) |
There was a problem hiding this comment.
Can you clarify this one? It's not need to add code in my testing. Also setting to null causes issues for people not allowing null's in their code base.
There was a problem hiding this comment.
This is not really needed. For what i see the Types.js file is not really used anywhere.
It does not contain any code
It's there just to give code completion.
My problem was that some CodeEditor's would not find the @typedef and won't give code completion as they assume that typedef is not defined.
But this probably a problem to be solved in code editors, not in code gen, thought it does not hurt anyone
There was a problem hiding this comment.
I'm not sure if it is removed by code minification, but potentially it can hurt "anyone" because you're potentially shipping more bytes through the wire.
| else params = 'options' | ||
| } | ||
|
|
||
| const docsArray=renderOperationDocs(op) |
There was a problem hiding this comment.
This gets you most of the way there, but the promise returned from redux action creators are not the same as the promise returned from the raw service call. This means there's incorrect promise typings being gen'd.
There was a problem hiding this comment.
Ohhh yes you are right, didn't tough about that as mostly i only wanted to get completion in action's arguments.
So probably this needs more work, can't just use the same gen docs from the other methods.
| import { writeFileSync, join, groupOperationsByGroupName, camelToUppercase, getBestResponse } from '../util' | ||
| import { DOC, SP, ST, getDocType, getTSParamType } from './support' | ||
| import { renderParamSignature, renderOperationGroup } from './genOperations' | ||
| import {renderParamSignature, renderOperationGroup, renderOperationDocs} from './genOperations' |
There was a problem hiding this comment.
Yeah, right. The block was formatted by the code editor on import.
Should have payed more attention before commit and submit the PR
|
@porfirioribeiro thanks for the pull request. Left a few comments. |
|
@mikestead I will look at all your comments and try to fix all. |
Generate the same docs for redux actions as we have in plain openapi call's
Usefull for code completition of actions