Skip to content

Commit

Permalink
Improve swagger docs (#449)
Browse files Browse the repository at this point in the history
advthreat/iroh#8946

Via flanders changes, adds examples to the json docs and swagger metadata.

We reuse `:default` to populate examples here. This has undesirable effects on the documentation. I reviewed the existing documentation around defaults, and many were not appropriate for user-facing docs. The closest to useful was that tlp defaults to green, but this is configurable in CTIA so that is debatable.

Instead of developing another flanders feature, I disabled default values from printing in the docs. We might want to revisit this if we actually use defaults in a user-facing way (not just generating examples).
  • Loading branch information
frenchy64 authored Jul 22, 2024
1 parent 4a0d3fd commit 795a474
Show file tree
Hide file tree
Showing 49 changed files with 2,964 additions and 2,927 deletions.
54 changes: 27 additions & 27 deletions doc/json/actor.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"confidence" : "string",
"tlp" : "string",
"actor_types" : [ "Cyber Espionage Operations" ],
"aliases" : [ "string" ],
"confidence" : "High",
"description" : "string",
"external_ids" : [ "string" ],
"external_references" : [ {
"description" : "string",
"external_id" : "string",
"hashes" : [ "string" ],
"source_name" : "string",
"url" : "string"
} ],
"id" : "string",
"timestamp" : "2016-01-01T01:01:01.000Z",
"valid_time" : {
"start_time" : "2016-01-01T01:01:01.000Z",
"end_time" : "2016-01-01T01:01:01.000Z"
},
"revision" : 10,
"identity" : {
"description" : "string",
"related_identities" : [ {
"confidence" : "High",
"identity" : "string",
"confidence" : "string",
"information_source" : "string",
"relationship" : "string"
} ]
},
"short_description" : "string",
"sophistication" : "string",
"intended_effect" : "Account Takeover",
"language" : "string",
"motivation" : "Ego",
"planning_and_operational_support" : "string",
"schema_version" : "string",
"title" : "string",
"revision" : 10,
"schema_version" : "1.3.18",
"short_description" : "string",
"sophistication" : "Aspirant",
"source" : "string",
"actor_types" : [ "string" ],
"type" : "string",
"intended_effect" : "string",
"source_uri" : "string",
"language" : "string",
"external_references" : [ {
"source_name" : "string",
"description" : "string",
"url" : "string",
"hashes" : [ "string" ],
"external_id" : "string"
} ],
"motivation" : "string",
"description" : "string",
"external_ids" : [ "string" ]
"timestamp" : "2016-01-01T01:01:01.000Z",
"title" : "string",
"tlp" : "green",
"type" : "actor",
"valid_time" : {
"end_time" : "2016-01-01T01:01:01.000Z",
"start_time" : "2016-01-01T01:01:01.000Z"
}
}
40 changes: 20 additions & 20 deletions doc/json/asset.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"tlp" : "string",
"asset_type" : "application",
"description" : "string",
"external_ids" : [ "string" ],
"external_references" : [ {
"description" : "string",
"external_id" : "string",
"hashes" : [ "string" ],
"source_name" : "string",
"url" : "string"
} ],
"id" : "string",
"timestamp" : "2016-01-01T01:01:01.000Z",
"valid_time" : {
"start_time" : "2016-01-01T01:01:01.000Z",
"end_time" : "2016-01-01T01:01:01.000Z"
},
"language" : "string",
"revision" : 10,
"schema_version" : "1.3.18",
"short_description" : "string",
"schema_version" : "string",
"title" : "string",
"source" : "string",
"type" : "string",
"source_uri" : "string",
"asset_type" : "string",
"language" : "string",
"external_references" : [ {
"source_name" : "string",
"description" : "string",
"url" : "string",
"hashes" : [ "string" ],
"external_id" : "string"
} ],
"description" : "string",
"external_ids" : [ "string" ]
"timestamp" : "2016-01-01T01:01:01.000Z",
"title" : "string",
"tlp" : "green",
"type" : "asset",
"valid_time" : {
"end_time" : "2016-01-01T01:01:01.000Z",
"start_time" : "2016-01-01T01:01:01.000Z"
}
}
48 changes: 24 additions & 24 deletions doc/json/asset_mapping.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"confidence" : "string",
"tlp" : "string",
"asset_ref" : "string",
"asset_type" : "application",
"confidence" : "High",
"external_ids" : [ "string" ],
"external_references" : [ {
"description" : "string",
"external_id" : "string",
"hashes" : [ "string" ],
"source_name" : "string",
"url" : "string"
} ],
"id" : "string",
"timestamp" : "2016-01-01T01:01:01.000Z",
"valid_time" : {
"start_time" : "2016-01-01T01:01:01.000Z",
"end_time" : "2016-01-01T01:01:01.000Z"
},
"revision" : 10,
"specificity" : "string",
"language" : "string",
"observable" : {
"value" : "string",
"type" : "string"
"type" : "ip",
"value" : "1.2.3.4"
},
"stability" : "string",
"schema_version" : "string",
"revision" : 10,
"schema_version" : "1.3.18",
"source" : "string",
"type" : "string",
"source_uri" : "string",
"asset_type" : "string",
"language" : "string",
"external_references" : [ {
"source_name" : "string",
"description" : "string",
"url" : "string",
"hashes" : [ "string" ],
"external_id" : "string"
} ],
"external_ids" : [ "string" ]
"specificity" : "Low",
"stability" : "Managed",
"timestamp" : "2016-01-01T01:01:01.000Z",
"tlp" : "green",
"type" : "asset-mapping",
"valid_time" : {
"end_time" : "2016-01-01T01:01:01.000Z",
"start_time" : "2016-01-01T01:01:01.000Z"
}
}
38 changes: 19 additions & 19 deletions doc/json/asset_properties.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"asset_ref" : "string",
"external_ids" : [ "string" ],
"external_references" : [ {
"description" : "string",
"external_id" : "string",
"hashes" : [ "string" ],
"source_name" : "string",
"url" : "string"
} ],
"id" : "string",
"language" : "string",
"properties" : [ {
"name" : "string",
"value" : "string"
} ],
"tlp" : "string",
"asset_ref" : "string",
"id" : "string",
"timestamp" : "2016-01-01T01:01:01.000Z",
"valid_time" : {
"start_time" : "2016-01-01T01:01:01.000Z",
"end_time" : "2016-01-01T01:01:01.000Z"
},
"revision" : 10,
"schema_version" : "string",
"schema_version" : "1.3.18",
"source" : "string",
"type" : "string",
"source_uri" : "string",
"language" : "string",
"external_references" : [ {
"source_name" : "string",
"description" : "string",
"url" : "string",
"hashes" : [ "string" ],
"external_id" : "string"
} ],
"external_ids" : [ "string" ]
"timestamp" : "2016-01-01T01:01:01.000Z",
"tlp" : "green",
"type" : "asset-properties",
"valid_time" : {
"end_time" : "2016-01-01T01:01:01.000Z",
"start_time" : "2016-01-01T01:01:01.000Z"
}
}
40 changes: 20 additions & 20 deletions doc/json/attack_pattern.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"tlp" : "string",
"x_mitre_platforms" : [ "string" ],
"x_mitre_data_sources" : [ "string" ],
"abstraction_level" : "aggregate",
"description" : "string",
"external_ids" : [ "string" ],
"external_references" : [ {
"description" : "string",
"external_id" : "string",
"hashes" : [ "string" ],
"source_name" : "string",
"url" : "string"
} ],
"id" : "string",
"kill_chain_phases" : [ {
"kill_chain_name" : "string",
"phase_name" : "string"
} ],
"id" : "string",
"timestamp" : "2016-01-01T01:01:01.000Z",
"language" : "string",
"revision" : 10,
"x_mitre_contributors" : [ "string" ],
"abstraction_level" : "string",
"schema_version" : "1.3.18",
"short_description" : "string",
"schema_version" : "string",
"title" : "string",
"source" : "string",
"type" : "string",
"source_uri" : "string",
"language" : "string",
"external_references" : [ {
"source_name" : "string",
"description" : "string",
"url" : "string",
"hashes" : [ "string" ],
"external_id" : "string"
} ],
"description" : "string",
"external_ids" : [ "string" ]
"timestamp" : "2016-01-01T01:01:01.000Z",
"title" : "string",
"tlp" : "green",
"type" : "attack-pattern",
"x_mitre_contributors" : [ "string" ],
"x_mitre_data_sources" : [ "string" ],
"x_mitre_platforms" : [ "string" ]
}
Loading

0 comments on commit 795a474

Please sign in to comment.