Object: ggStock
Schema
Json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CompanyStockProfile",
"description": "A profile detailing a corporation's stock market presence, including historical market data structured as a dictionary with timestamps as keys.",
"type": "object",
"properties": {
"symbol": {
"description": "Corporation's stock ticker symbol.",
"type": "string"
},
"companyName": {
"description": "Registered corporation name.",
"type": "string"
},
"exchange": {
"description": "Stock exchange where the stock is listed.",
"type": "string"
},
"industry": {
"description": "Corporation's primary industry.",
"type": "string"
},
"currentPrice": {
"description": "Current stock trading price.",
"type": "number",
"minimum": 0
},
"marketCap": {
"description": "Market value of outstanding shares.",
"type": "number",
"minimum": 0
},
"volume": {
"description": "Volume of shares traded last session.",
"type": "integer",
"minimum": 0
},
"peRatio": {
"description": "Price-to-Earnings ratio.",
"type": "number"
},
"dividendYield": {
"description": "Annual dividend yield percentage.",
"type": "number",
"minimum": 0
},
"eps": {
"description": "Earnings Per Share.",
"type": "number"
},
"week52High": {
"description": "52-week highest trading price.",
"type": "number",
"minimum": 0
},
"week52Low": {
"description": "52-week lowest trading price.",
"type": "number",
"minimum": 0
},
"historicalData": {
"description": "Dictionary of historical market data, keyed by timestamps.",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"oneMinute": {
"description": "Data for the 1-minute candle.",
"type": "object",
"properties": {
"open": {"type": "number"},
"high": {"type": "number"},
"low": {"type": "number"},
"close": {"type": "number"},
"volume": {"type": "integer", "minimum": 0}
},
"required": ["open", "high", "low", "close", "volume"]
},
"fiveMinute": {
"description": "Optional data for the 5-minute candle.",
"type": "object",
"properties": {
"open": {"type": "number"},
"high": {"type": "number"},
"low": {"type": "number"},
"close": {"type": "number"},
"volume": {"type": "integer", "minimum": 0}
},
"required": ["open", "high", "low", "close", "volume"]
}
},
"required": ["oneMinute"]
}
}
},
"required": ["symbol", "companyName", "currentPrice", "historicalData"],
"additionalProperties": false
}
Yang
module company-stock-profile {
namespace "http://example.com/company-stock-profile";
prefix csp;
organization "Example Organization";
description "A profile detailing a corporation's stock market presence, including historical market data structured as a dictionary with timestamps as keys.";
container companyStockProfile {
leaf symbol {
type string;
description "Corporation's stock ticker symbol.";
}
leaf companyName {
type string;
description "Registered corporation name.";
}
leaf exchange {
type string;
description "Stock exchange where the stock is listed.";
}
leaf industry {
type string;
description "Corporation's primary industry.";
}
leaf currentPrice {
type decimal64 {
fraction-digits 2;
}
description "Current stock trading price.";
}
leaf marketCap {
type decimal64 {
fraction-digits 2;
}
description "Market value of outstanding shares.";
}
leaf volume {
type uint64;
description "Volume of shares traded last session.";
}
leaf peRatio {
type decimal64 {
fraction-digits 2;
}
description "Price-to-Earnings ratio.";
}
leaf dividendYield {
type decimal64 {
fraction-digits 2;
}
description "Annual dividend yield percentage.";
}
leaf eps {
type decimal64 {
fraction-digits 2;
}
description "Earnings Per Share.";
}
leaf week52High {
type decimal64 {
fraction-digits 2;
}
description "52-week highest trading price.";
}
leaf week52Low {
type decimal64 {
fraction-digits 2;
}
description "52-week lowest trading price.";
}
container historicalData {
description "Dictionary of historical market data, keyed by timestamps.";
list candleData {
key "timestamp";
leaf timestamp {
type string;
description "Timestamp marking the beginning of the candle.";
}
container oneMinute {
description "Data for the 1-minute candle.";
leaf open {
type decimal64 {
fraction-digits 2;
}
}
leaf high {
type decimal64 {
fraction-digits 2;
}
}
leaf low {
type decimal64 {
fraction-digits 2;
}
}
leaf close {
type decimal64 {
fraction-digits 2;
}
}
leaf volume {
type uint64;
}
}
container fiveMinute {
description "Optional data for the 5-minute candle.";
leaf open {
type decimal64 {
fraction-digits 2;
}
}
leaf high {
type decimal64 {
fraction-digits 2;
}
}
leaf low {
type decimal64 {
fraction-digits 2;
}
}
leaf close {
type decimal64 {
fraction-digits 2;
}
}
leaf volume {
type uint64;
}
}
}
}
}
}
Example Object