Skip to content

Commit

Permalink
Add OOP and Meta properties for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
botder committed Oct 10, 2024
1 parent a4b2073 commit 003d850
Showing 1 changed file with 58 additions and 7 deletions.
65 changes: 58 additions & 7 deletions schemas/function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ type: object

properties:
shared:
description: A shared specification of a function.
description: |
A shared specification of a function.
You must always create a server and a client property, and merge this into both
using a reference.
$ref: '#/$defs/common_properties'
server:
description: A server-side specification of a function.
Expand All @@ -26,6 +29,13 @@ $defs:
pair:
type: string
description: Associates this function with another getter or setter function.
oop:
$ref: '#/$defs/oop'
is_disabled:
type: string
description: Describe why the function was disabled, and if there is an alternative approach.
meta:
$ref: '#/$defs/meta'
description:
type: string
description: Describes the functionality provided by the function.
Expand Down Expand Up @@ -58,18 +68,63 @@ $defs:
$ref: '#/$defs/examples'
see_also:
type: array
description: A list of other items and categories for further reading.
description: |
A list of other items and categories for further reading.
Every function will implicitly display it's own category in *See Also*, unless you
introduce this property, then you have to be explicit about it.
items:
type: string
pattern: "^(item|category|tag):"
uniqueItems: true

oop:
type: object
description: Object-Oriented Programming (OOP) information block for the function.
required:
- entity
properties:
note:
type: string
description: A piece of information to show alongside OOP syntax.
entity:
type: string
description: Name of the element or userdata.
oneOf:
- required:
- method
properties:
method:
type: string
description: Name of the method.
static:
type: boolean
default: false
description: If set to true, this method will be marked as static.
variable:
type: string
description: Name of the variable without a leading dot.
- required:
- constructor
properties:
constructor:
type: string
description: Name of the constructor.

meta:
type: array
description: A list of meta properties about the function and it's documentation.
items:
type: object
properties:
needs_checking:
type: string
description: Describe why the function needs checking by another person. What's problematic?

preview:
type: array
description: A list of picture assets demonstrating the function.
items:
type: object
description: A single function preview.
required:
- path
properties:
Expand All @@ -85,7 +140,6 @@ $defs:
description: A list of required and optional parameters for the function.
items:
type: object
description: A single function parameter.
required:
- name
- type
Expand Down Expand Up @@ -123,7 +177,6 @@ $defs:
description: A list of named values returned by the function.
items:
type: object
description: A single function return value.
required:
- type
- name
Expand Down Expand Up @@ -156,7 +209,6 @@ $defs:
description: A list of related issues for this function.
items:
type: object
description: A single function-related issue.
required:
- id
- description
Expand All @@ -173,7 +225,6 @@ $defs:
description: A list of source code examples demonstrating the function.
items:
type: object
description: A single source code example.
required:
- path
properties:
Expand Down

0 comments on commit 003d850

Please sign in to comment.