Skip to content
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

stacktrace property in v2 error spec should list properties under items property #4515

Closed
russcam opened this issue Dec 10, 2020 · 0 comments · Fixed by #4516
Closed

stacktrace property in v2 error spec should list properties under items property #4515

russcam opened this issue Dec 10, 2020 · 0 comments · Fixed by #4516
Labels

Comments

@russcam
Copy link
Contributor

russcam commented Dec 10, 2020

The properties of each frame in a stacktrace are listed as properties of the stacktrace:

"stacktrace": {
"description": "Stacktrace information of the captured exception.",
"type": [
"null",
"array"
],
"properties": {
"abs_path": {
"description": "AbsPath is the absolute path of the frame's file.",
"type": [
"null",
"string"
]
},
"classname": {
"description": "Classname of the frame.",
"type": [
"null",
"string"
]
},
"colno": {
"description": "ColumnNumber of the frame.",
"type": [
"null",
"integer"
]
},
"context_line": {
"description": "ContextLine is the line from the frame's file.",
"type": [
"null",
"string"
]
},
"filename": {
"description": "Filename is the relative name of the frame's file.",
"type": [
"null",
"string"
]
},
"function": {
"description": "Function represented by the frame.",
"type": [
"null",
"string"
]
},
"library_frame": {
"description": "LibraryFrame indicates whether the frame is from a third party library.",
"type": [
"null",
"boolean"
]
},
"lineno": {
"description": "LineNumber of the frame.",
"type": [
"null",
"integer"
]
},
"module": {
"description": "Module to which the frame belongs to.",
"type": [
"null",
"string"
]
},
"post_context": {
"description": "PostContext is a slice of code lines immediately before the line from the frame's file.",
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"minItems": 0
},
"pre_context": {
"description": "PreContext is a slice of code lines immediately after the line from the frame's file.",
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"minItems": 0
},
"vars": {
"description": "Vars is a flat mapping of local variables of the frame.",
"type": [
"null",
"object"
]
}
},

It looks like these should be listed as properties of the items schema (the frames) of a stacktrace i.e.

"stacktrace": {
    "description": "Stacktrace information of the captured exception.",
    "type": [
        "null",
        "array"
    ],
    "items": {
        "type": "object",
        "properties": {
            "abs_path": {
                "description": "AbsPath is the absolute path of the frame's file.",
                "type": [
                    "null",
                    "string"
                ]
            },
            "classname": {
                "description": "Classname of the frame.",
                "type": [
                    "null",
                    "string"
                ]
            },
            "colno": {
                "description": "ColumnNumber of the frame.",
                "type": [
                    "null",
                    "integer"
                ]
            },
            "context_line": {
                "description": "ContextLine is the line from the frame's file.",
                "type": [
                    "null",
                    "string"
                ]
            },
            "filename": {
                "description": "Filename is the relative name of the frame's file.",
                "type": [
                    "null",
                    "string"
                ]
            },
            "function": {
                "description": "Function represented by the frame.",
                "type": [
                    "null",
                    "string"
                ]
            },
            "library_frame": {
                "description": "LibraryFrame indicates whether the frame is from a third party library.",
                "type": [
                    "null",
                    "boolean"
                ]
            },
            "lineno": {
                "description": "LineNumber of the frame.",
                "type": [
                    "null",
                    "integer"
                ]
            },
            "module": {
                "description": "Module to which the frame belongs to.",
                "type": [
                    "null",
                    "string"
                ]
            },
            "post_context": {
                "description": "PostContext is a slice of code lines immediately before the line from the frame's file.",
                "type": [
                    "null",
                    "array"
                ],
                "items": {
                    "type": "string"
                },
                "minItems": 0
            },
            "pre_context": {
                "description": "PreContext is a slice of code lines immediately after the line from the frame's file.",
                "type": [
                    "null",
                    "array"
                ],
                "items": {
                    "type": "string"
                },
                "minItems": 0
            },
            "vars": {
                "description": "Vars is a flat mapping of local variables of the frame.",
                "type": [
                    "null",
                    "object"
                ]
            }
        },
        "anyOf": [
            {
                "properties": {
                    "classname": {
                        "type": "string"
                    }
                },
                "required": [
                    "classname"
                ]
            },
            {
                "properties": {
                    "filename": {
                        "type": "string"
                    }
                },
                "required": [
                    "filename"
                ]
            }
        ]
    },
    "minItems": 0
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant