mirror of
https://github.com/gosticks/octoprint-open-api.git
synced 2025-10-16 11:45:38 +00:00
update license and readme
This commit is contained in:
parent
8244bb21e9
commit
7431485e10
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Ivan Goncharov
|
||||
Copyright (c) 2016 Wlad Meixner
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
93
README.md
93
README.md
@ -1,13 +1,13 @@
|
||||
# OctoPrint OpenAPI Definition
|
||||
|
||||
This project contains OpenAPI definitions for the popular OctoPrint control library
|
||||
This project proved a unofficial OpenAPI specification for the popular open source 3D printer control software OctoPrint. The definitions are based on the currently available OctoPrint api documentation.
|
||||
|
||||
## Working on your OpenAPI Definition
|
||||
|
||||
### Install
|
||||
|
||||
1. Install [Node JS](https://nodejs.org/).
|
||||
2. Clone this repo and run `npm install` in the repo root.
|
||||
2. Clone this repo and run `yarn install`/`npm install` in the repo root.
|
||||
|
||||
### Usage
|
||||
|
||||
@ -38,7 +38,6 @@ docs engine. Open it to find examples and
|
||||
[read the docs](https://redoc.ly/docs/cli/configuration/)
|
||||
for more information.
|
||||
|
||||
|
||||
### Schemas
|
||||
|
||||
#### Adding Schemas
|
||||
@ -48,85 +47,6 @@ for more information.
|
||||
3. Define the schema.
|
||||
4. Refer to the schema using the `$ref` (see example below).
|
||||
|
||||
##### Example Schema
|
||||
This is a very simple schema example:
|
||||
```yaml
|
||||
type: string
|
||||
description: The resource ID. Defaults to UUID v4
|
||||
maxLength: 50
|
||||
example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
|
||||
```
|
||||
This is a more complex schema example:
|
||||
```yaml
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
description: The customer identifier string
|
||||
readOnly: true
|
||||
allOf:
|
||||
- $ref: ./ResourceId.yaml
|
||||
websiteId:
|
||||
description: The website's ID
|
||||
allOf:
|
||||
- $ref: ./ResourceId.yaml
|
||||
paymentToken:
|
||||
type: string
|
||||
writeOnly: true
|
||||
description: |
|
||||
A write-only payment token; if supplied, it will be converted into a
|
||||
payment instrument and be set as the `defaultPaymentInstrument`. The
|
||||
value of this property will override the `defaultPaymentInstrument`
|
||||
in the case that both are supplied. The token may only be used once
|
||||
before it is expired.
|
||||
defaultPaymentInstrument:
|
||||
$ref: ./PaymentInstrument.yaml
|
||||
createdTime:
|
||||
description: The customer created time
|
||||
allOf:
|
||||
- $ref: ./ServerTimestamp.yaml
|
||||
updatedTime:
|
||||
description: The customer updated time
|
||||
allOf:
|
||||
- $ref: ./ServerTimestamp.yaml
|
||||
tags:
|
||||
description: A list of customer's tags
|
||||
readOnly: true
|
||||
type: array
|
||||
items:
|
||||
$ref: ./Tags/Tag.yaml
|
||||
revision:
|
||||
description: >
|
||||
The number of times the customer data has been modified.
|
||||
|
||||
The revision is useful when analyzing webhook data to determine if the
|
||||
change takes precedence over the current representation.
|
||||
type: integer
|
||||
readOnly: true
|
||||
_links:
|
||||
type: array
|
||||
description: The links related to resource
|
||||
readOnly: true
|
||||
minItems: 3
|
||||
items:
|
||||
anyOf:
|
||||
- $ref: ./Links/SelfLink.yaml
|
||||
- $ref: ./Links/NotesLink.yaml
|
||||
- $ref: ./Links/DefaultPaymentInstrumentLink.yaml
|
||||
- $ref: ./Links/LeadSourceLink.yaml
|
||||
- $ref: ./Links/WebsiteLink.yaml
|
||||
_embedded:
|
||||
type: array
|
||||
description: >-
|
||||
Any embedded objects available that are requested by the `expand`
|
||||
querystring parameter.
|
||||
readOnly: true
|
||||
minItems: 1
|
||||
items:
|
||||
anyOf:
|
||||
- $ref: ./Embeds/LeadSourceEmbed.yaml
|
||||
|
||||
```
|
||||
|
||||
##### Using the `$ref`
|
||||
|
||||
Notice in the complex example above the schema definition itself has `$ref` links to other schemas defined.
|
||||
@ -241,12 +161,3 @@ You'll see extensive usage of `$ref`s in this example to different types of comp
|
||||
|
||||
You'll also notice `$ref`s to code samples.
|
||||
|
||||
### Code samples
|
||||
|
||||
1. Navigate to the `openapi/code_samples` folder.
|
||||
2. Navigate to the `<language>` (e.g. PHP) sub-folder.
|
||||
3. Navigate to the `path` folder, and add ref to the code sample.
|
||||
|
||||
You can add languages by adding new folders at the appropriate path level.
|
||||
|
||||
More details inside the `code_samples` folder README.
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "octoprint",
|
||||
"name": "octoprint-openapi",
|
||||
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@redocly/openapi-cli": "^1.0.0-beta.18"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "openapi preview-docs",
|
||||
"build": "openapi bundle -o dist",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user