mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Updated API Code Samples (#24141)
* api: remove PHP code samples * api: remove Curl code samples * api: remove Go code samples * link out to marketplace exclusively for community-built drivers * absolute path to V4_SRC * programmatically extract x-codeSamples * initial batch of examples * Update api/server/main.go Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> * Update api/server/main.go Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> * Update api/server/main.go Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com> * updated examples --------- Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
This commit is contained in:
14
api/Makefile
14
api/Makefile
@@ -1,9 +1,11 @@
|
||||
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
.PHONY: build build-v4 clean playbooks
|
||||
|
||||
V4_YAML = v4/html/static/mattermost-openapi-v4.yaml
|
||||
V4_YAML = $(ROOT)/v4/html/static/mattermost-openapi-v4.yaml
|
||||
|
||||
V4_SRC = v4/source
|
||||
PLAYBOOKS_SRC = playbooks
|
||||
V4_SRC = $(ROOT)/v4/source
|
||||
PLAYBOOKS_SRC = $(ROOT)/playbooks
|
||||
|
||||
build: build-v4
|
||||
|
||||
@@ -50,6 +52,8 @@ build-v4: node_modules playbooks
|
||||
@cat $(V4_SRC)/exports.yaml >> $(V4_YAML)
|
||||
@if [ -r $(PLAYBOOKS_SRC)/paths.yaml ]; then cat $(PLAYBOOKS_SRC)/paths.yaml >> $(V4_YAML); fi
|
||||
@if [ -r $(PLAYBOOKS_SRC)/merged-definitions.yaml ]; then cat $(PLAYBOOKS_SRC)/merged-definitions.yaml >> $(V4_YAML); else cat $(V4_SRC)/definitions.yaml >> $(V4_YAML); fi
|
||||
@echo Extracting code samples
|
||||
cd server && go run . $(V4_YAML)
|
||||
|
||||
@node_modules/.bin/swagger-cli validate $(V4_YAML)
|
||||
@node_modules/.bin/redoc-cli -t ./v4/html/ssr_template.hbs build ./v4/html/static/mattermost-openapi-v4.yaml -o ./v4/html/index.html --options.noAutoAuth --options.suppressWarnings
|
||||
@@ -74,5 +78,5 @@ clean:
|
||||
playbooks:
|
||||
@echo Fetching Playbooks OpenAPI spec
|
||||
cd playbooks && node extract.js
|
||||
cd playbooks && node merge-definitions.js ../$(V4_SRC)/definitions.yaml
|
||||
cd playbooks && node merge-tags.js ../$(V4_SRC)/introduction.yaml
|
||||
cd playbooks && node merge-definitions.js $(V4_SRC)/definitions.yaml
|
||||
cd playbooks && node merge-tags.js $(V4_SRC)/introduction.yaml
|
||||
|
||||
Reference in New Issue
Block a user