Skip to content

Commit

Permalink
[api] Remove conflicting documentation for OpenAPI spec
Browse files Browse the repository at this point in the history
Turns out open API spec generation was building a version that wasn't compatible
with some client generators.
  • Loading branch information
gregnazario committed Sep 9, 2022

Verified

This commit was signed with the committer’s verified signature.
Robbepop Robin Freyler
1 parent bba1690 commit df2b4b0
Showing 49 changed files with 386 additions and 1,880 deletions.
1,047 changes: 123 additions & 924 deletions api/doc/spec.json

Large diffs are not rendered by default.

484 changes: 119 additions & 365 deletions api/doc/spec.yaml

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions api/types/src/account.rs
Original file line number Diff line number Diff line change
@@ -12,13 +12,7 @@ use serde::{Deserialize, Serialize};
/// A simplified version of the onchain Account resource
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct AccountData {
/// Next sequence number of the account
///
/// This will be the sequence number of the next transaction committed on this account
pub sequence_number: U64,
/// Authentication key
///
/// A SHA-256 of public keys and authentication scheme of the account
pub authentication_key: HexEncodedBytes,
}

6 changes: 0 additions & 6 deletions api/types/src/block.rs
Original file line number Diff line number Diff line change
@@ -11,15 +11,10 @@ use serde::{Deserialize, Serialize};
/// associated transactions if requested
#[derive(Debug, Clone, Serialize, Deserialize, Object)]
pub struct Block {
/// The block height (number of the block from 0)
pub block_height: U64,
/// The block hash
pub block_hash: HashValue,
/// The block timestamp in Unix epoch microseconds
pub block_timestamp: U64,
/// The first ledger version of the block inclusive
pub first_version: U64,
/// The last ledger version of the block inclusive
pub last_version: U64,
/// The transactions in the block in sequential order
#[serde(skip_serializing_if = "Option::is_none")]
@@ -34,7 +29,6 @@ pub struct Block {
pub struct BcsBlock {
/// The block height (number of the block from 0)
pub block_height: u64,
/// The block hash
pub block_hash: aptos_crypto::HashValue,
/// The block timestamp in Unix epoch microseconds
pub block_timestamp: u64,
1 change: 0 additions & 1 deletion api/types/src/error.rs
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ use std::fmt::Formatter;
pub struct AptosError {
/// A message describing the error
pub message: String,
/// A code providing more granular error information beyond the HTTP status code
pub error_code: AptosErrorCode,
/// A code providing VM error details when submitting transactions to the VM
pub vm_error_code: Option<u64>,
7 changes: 0 additions & 7 deletions api/types/src/index.rs
Original file line number Diff line number Diff line change
@@ -15,19 +15,12 @@ use serde::{Deserialize, Serialize};
pub struct IndexResponse {
/// Chain ID of the current chain
pub chain_id: u8,
/// Current epoch of the chain
pub epoch: U64,
/// Current ledger version of the chain
pub ledger_version: U64,
/// Oldest non-pruned ledger version of the chain
pub oldest_ledger_version: U64,
/// Current timestamp of the chain
pub ledger_timestamp: U64,
/// Role of the node `Validator` or `FullNode`
pub node_role: RoleType,
/// Oldest non-pruned block height of the chain
pub oldest_block_height: U64,
/// Current block height of the chain
pub block_height: U64,
}

6 changes: 0 additions & 6 deletions api/types/src/ledger_info.rs
Original file line number Diff line number Diff line change
@@ -13,17 +13,11 @@ use serde::{Deserialize, Serialize};
pub struct LedgerInfo {
/// Chain ID of the current chain
pub chain_id: u8,
/// Current epoch of the chain
pub epoch: U64,
/// Current ledger version of the chain
pub ledger_version: U64,
/// Oldest non-pruned ledger version of the chain
pub oldest_ledger_version: U64,
/// Current block height of the chain
pub block_height: U64,
/// Oldest non-pruned block height of the chain
pub oldest_block_height: U64,
/// Current timestamp of the chain
pub ledger_timestamp: U64,
}

25 changes: 0 additions & 25 deletions api/types/src/move_types.rs
Original file line number Diff line number Diff line change
@@ -35,11 +35,9 @@ use std::{
/// A parsed Move resource
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveResource {
/// The Move struct tag e.g. 0x1::account::Account
#[serde(rename = "type")]
#[oai(rename = "type")]
pub typ: MoveStructTag,
/// The JSON struct data converted from the Move resource
pub data: MoveStructValue,
}

@@ -285,19 +283,14 @@ impl TryFrom<AnnotatedMoveStruct> for MoveStructValue {
pub enum MoveValue {
/// A u8 Move type
U8(u8),
/// A u64 Move type
U64(U64),
/// A u128 Move type
U128(U128),
/// A bool Move type
Bool(bool),
/// A 32-byte address Move type
Address(Address),
/// A vector Move type. May have any other [`MoveValue`] nested inside it
Vector(Vec<MoveValue>),
/// A bytes Move type, hex encoded
Bytes(HexEncodedBytes),
/// A struct Move type, with a map of fields inside it
Struct(MoveStructValue),
/// A string Move type
String(String),
@@ -382,11 +375,8 @@ impl Serialize for MoveValue {
/// A Move struct tag for referencing an onchain struct type
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MoveStructTag {
/// The address of the struct's module
pub address: Address,
/// The module name containing the struct
pub module: IdentifierWrapper,
/// The name of the struct
pub name: IdentifierWrapper,
/// Generic type parameters associated with the struct
pub generic_type_params: Vec<MoveType>,
@@ -662,9 +652,7 @@ impl TryFrom<MoveType> for TypeTag {
/// A Move module
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveModule {
/// Address of the move module
pub address: Address,
/// Name of the module
pub name: IdentifierWrapper,
/// Friends of the module
pub friends: Vec<MoveModuleId>,
@@ -706,9 +694,7 @@ impl From<CompiledModule> for MoveModule {
/// A Move module Id
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MoveModuleId {
/// Address of the module
pub address: Address,
/// Name of the module
pub name: IdentifierWrapper,
}

@@ -772,7 +758,6 @@ impl<'de> Deserialize<'de> for MoveModuleId {
/// A move struct
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveStruct {
/// Name of the struct
pub name: IdentifierWrapper,
/// Whether the struct is a native struct of Move
pub is_native: bool,
@@ -871,9 +856,7 @@ impl From<&StructTypeParameter> for MoveStructGenericTypeParam {
/// Move struct field
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveStructField {
/// Name of the field
pub name: IdentifierWrapper,
/// The move type associated with the field. e.g. bool
#[serde(rename = "type")]
#[oai(rename = "type")]
pub typ: MoveType,
@@ -882,9 +865,7 @@ pub struct MoveStructField {
/// Move function
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveFunction {
/// Name of the function
pub name: IdentifierWrapper,
/// Visibility of the function e.g. public
pub visibility: MoveFunctionVisibility,
/// Whether the function can be called as an entry function directly in a transaction
pub is_entry: bool,
@@ -971,9 +952,7 @@ impl From<&AbilitySet> for MoveFunctionGenericTypeParam {
/// Move module bytecode along with it's ABI
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveModuleBytecode {
/// Hex encoded bytecode of the module
pub bytecode: HexEncodedBytes,
/// ABI of the module
// We don't need deserialize MoveModule as it should be serialized
// from `bytecode`.
#[serde(skip_deserializing)]
@@ -1010,9 +989,7 @@ impl From<Module> for MoveModuleBytecode {
/// Move script bytecode
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveScriptBytecode {
/// Hex encoded bytecode of the script
pub bytecode: HexEncodedBytes,
/// ABI of the script
// We don't need deserialize MoveModule as it should be serialized
// from `bytecode`.
#[serde(skip_deserializing)]
@@ -1043,9 +1020,7 @@ impl MoveScriptBytecode {
/// Entry function id
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct EntryFunctionId {
/// Module Id e.g. 0x1::address
pub module: MoveModuleId,
/// Function name
pub name: IdentifierWrapper,
}

2 changes: 0 additions & 2 deletions api/types/src/table.rs
Original file line number Diff line number Diff line change
@@ -9,9 +9,7 @@ use serde_json::Value;
/// Table Item request for the GetTableItem API
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct TableItemRequest {
/// The [`MoveType`] of the table item's key
pub key_type: MoveType,
/// The [`MoveType`] of the table item's value
pub value_type: MoveType,
/// The value of the table item's key
pub key: Value,
Loading

0 comments on commit df2b4b0

Please sign in to comment.