-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Schema descriptions with \n or \r\n are split, but the // is only applied to the first line. Descriptions on properties are handled correctly.
For example, the following fragment in JSON
"Destiny.Entities.Items.DestinyItemSocketState": {
"type": "object",
"properties": {
...
"isEnabled": {
"type": "boolean",
"description": "Even if a plug is inserted, it doesn't mean it's enabled.\r\nThis flag indicates whether the plug is active and providing its benefits."
},
...
},
"description": "The status of a given item's socket. (which plug is inserted, if any: whether it is enabled, what \"reusable\" plugs can be inserted, etc...)\r\nIf I had it to do over, this would probably have a DestinyItemPlug representing the inserted item instead of most of these properties. :shrug:"
},generates the following Go code
// The status of a given item's socket. (which plug is inserted, if any: whether it is enabled, what "reusable" plugs can be inserted, etc...)
If I had it to do over, this would probably have a DestinyItemPlug representing the inserted item instead of most of these properties. :shrug:
type DestinyEntitiesItemsDestinyItemSocketState struct {
...
// Even if a plug is inserted, it doesn't mean it's enabled.
// This flag indicates whether the plug is active and providing its benefits.
IsEnabled *bool `json:"isEnabled,omitempty"`
...
}The property handling code call the function StringToGoComment to handle this.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels