-
Notifications
You must be signed in to change notification settings - Fork 4
Application custom config #71
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
Conversation
@@ -611,7 +617,7 @@ Function Update-SwaggerObject { | |||
} Else { | |||
$excludePath = ($InputObjectName -replace '.paths.', '') -replace "\.\w+", '' | |||
# Write-Warning "[status] New SDK Endpoint Found: `nOperationId: $($ThisObject.operationId) `nPath: $excludePath" | |||
Write-Error ("In '$($CurrentSDKName)' unknown operationId '$($ThisObject.operationId) - $($InputObjectName)'.") | |||
Write-Warning ("In '$($CurrentSDKName)' unknown operationId '$($ThisObject.operationId) - $($InputObjectName)'.") |
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 really didn't need to throw an error/ switched to write-warning
@@ -69,6 +69,9 @@ $TransformConfig = [Ordered]@{ | |||
'\[,' = '['; | |||
',]' = ']'; | |||
}; | |||
OverrideDefinitions = @( |
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.
the idea here is that if you want to replace an entire section of the Swagger spec you could do that by specifying the path of item you wish to replace and adding a corresponding json file in /CustomDefinitions/
directory
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.
Looks good to me, nice job with the added method of replacing things in the future if needed. I'm sure that'll come in handy!
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.
Looks good, nice job with the custom definitions. It'll make future work much easier
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.
Nice work! Looks good on my end
Issues
What does this solve?
The default models defined in our API specification are missing several properties in the Application model, This release manually re-defines the
config
model for the Application model.Is there anything particularly tricky?
I've added a new "find and replace" type of way to redefine the generated code. Instead of using regex, to find and replace many things, you just need to replace sections of the API model. Within the
apiTransform.ps1
file I've added aOverrideDefinitions
list. Within that list, one can denote a part of the SDK swagger spec to replace entirely. All you would need to do that would be to define a.json
file with the same name in the/Custom
directory.How should this be tested?
Using the current version of the V2 SDK (0.0.43) running the command:

remove-JCSystemGroupMember -SystemID 62ace7fbac30e538a6ba0ec8 -Groupid 604938c5232e1179d1e7bbdb
should return multiple status messagesUsing this version of the V2 SDK (0.0.44) running the command:

remove-JCSystemGroupMember -SystemID 62ace7fbac30e538a6ba0ec8 -Groupid 604938c5232e1179d1e7bbdb
should return the single status message as expected503 error should still catch and recover 😎

Screenshots