mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
15 lines
498 B
V
15 lines
498 B
V
module json2
|
|
|
|
// implements encoding json, this is not validated so implementations must be correct
|
|
pub interface JsonEncoder {
|
|
// to_json returns a string containing an objects json representation
|
|
to_json() string
|
|
}
|
|
|
|
// Encodable is an interface, that allows custom implementations for encoding structs to their string based JSON representations.
|
|
|
|
@[deprecated: 'use `to_json` to implement `JsonEncoder` instead']
|
|
@[deprecated_after: '2025-10-30']
|
|
pub interface Encodable {
|
|
json_str() string
|
|
}
|