From 21a13f2994b005f2e8db6db58e37e5b060fa61e3 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 19 Dec 2023 03:09:37 +0100 Subject: [PATCH] Fix operation names in JS, improve Markdown formatting --- CHANGELOG.md | 10 ++++ composer.json | 2 +- composer.lock | 54 +++++++++---------- examples/foobar-oas3.md | 8 +-- examples/js-client/advanced-oas3/client.js | 40 +++++++------- examples/js-client/advanced-oas3/jsdoc.js | 20 +++---- examples/js-client/petstore-oas3/client.js | 12 ++--- examples/js-client/petstore-oas3/jsdoc.js | 6 +-- examples/js-client/uspto-oas3/client.js | 8 +-- examples/js-client/uspto-oas3/jsdoc.js | 4 +- examples/js-client/xhprof-collector/client.js | 28 +++++----- examples/js-client/xhprof-collector/jsdoc.js | 16 +++--- examples/petstore-oas3.md | 2 +- examples/rhsm.md | 18 +++---- examples/uspto-oas3.md | 6 +-- examples/xhprof-collector.md | 6 +-- src/Command/App.php | 2 +- src/JavaScript/Client/Client.php | 2 +- src/Markdown/APIDoc.php | 4 +- 19 files changed, 129 insertions(+), 119 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57c8259..8185af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.34] - 2023-12-19 + +### Fixed +- Operation id wasn't used as function name in JS client. +- Lack of space before base url in Markdown. + +### Added +- Anchors in Markdown operation tags. +- Dependencies updated. + ## [0.1.33] - 2023-08-04 ### Added diff --git a/composer.json b/composer.json index 8e18bb1..7d23f16 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "swaggest/php-code-builder": "^0.2.39", "swaggest/go-code-builder": "^0.4.50", "swaggest/code-builder": "^0.3.8", - "swaggest/json-cli": "^v1.11.0", + "swaggest/json-cli": "^v1.11.2", "php-yaoi/php-yaoi": "^1", "monolog/monolog": "^1.23", "bramus/monolog-colored-line-formatter": "^2.0", diff --git a/composer.lock b/composer.lock index d156dd2..b64fec1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ec76f296a96d82983ab20eb262a4ed28", + "content-hash": "e1ca540c8492e148bbd567ff6ceefdc2", "packages": [ { "name": "bramus/ansi-php", @@ -945,16 +945,16 @@ }, { "name": "swaggest/json-cli", - "version": "v1.11.1", + "version": "v1.11.2", "source": { "type": "git", "url": "https://github.com/swaggest/json-cli.git", - "reference": "a71376fe2fccefaf7b3fc44d8d22f198ee3c4909" + "reference": "147dbec6e6d75cf383fe5fe2c4ca88accefa742a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/json-cli/zipball/a71376fe2fccefaf7b3fc44d8d22f198ee3c4909", - "reference": "a71376fe2fccefaf7b3fc44d8d22f198ee3c4909", + "url": "https://api.github.com/repos/swaggest/json-cli/zipball/147dbec6e6d75cf383fe5fe2c4ca88accefa742a", + "reference": "147dbec6e6d75cf383fe5fe2c4ca88accefa742a", "shasum": "" }, "require": { @@ -966,7 +966,7 @@ "swaggest/json-diff": "^3.8.3", "swaggest/json-schema": "^0.12.41", "swaggest/json-schema-maker": "^0.3.7", - "swaggest/php-code-builder": "^0.2.38", + "swaggest/php-code-builder": "^0.2.41", "symfony/yaml": "^3" }, "require-dev": { @@ -994,22 +994,22 @@ "description": "JSON CLI tool (diff, rearrange, pretty print, minify, yaml convert, etc...)", "support": { "issues": "https://github.com/swaggest/json-cli/issues", - "source": "https://github.com/swaggest/json-cli/tree/v1.11.1" + "source": "https://github.com/swaggest/json-cli/tree/v1.11.2" }, - "time": "2022-11-14T22:06:21+00:00" + "time": "2023-12-19T00:50:30+00:00" }, { "name": "swaggest/json-diff", - "version": "v3.10.4", + "version": "v3.10.5", "source": { "type": "git", "url": "https://github.com/swaggest/json-diff.git", - "reference": "f4e511708060ff7511a3743fab4aa484a062bcfb" + "reference": "17bfc66b330f46e12a7e574133497a290cd79ba5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/json-diff/zipball/f4e511708060ff7511a3743fab4aa484a062bcfb", - "reference": "f4e511708060ff7511a3743fab4aa484a062bcfb", + "url": "https://api.github.com/repos/swaggest/json-diff/zipball/17bfc66b330f46e12a7e574133497a290cd79ba5", + "reference": "17bfc66b330f46e12a7e574133497a290cd79ba5", "shasum": "" }, "require": { @@ -1037,22 +1037,22 @@ "description": "JSON diff/rearrange/patch/pointer library for PHP", "support": { "issues": "https://github.com/swaggest/json-diff/issues", - "source": "https://github.com/swaggest/json-diff/tree/v3.10.4" + "source": "https://github.com/swaggest/json-diff/tree/v3.10.5" }, - "time": "2022-11-09T13:21:05+00:00" + "time": "2023-11-17T11:12:46+00:00" }, { "name": "swaggest/json-schema", - "version": "v0.12.41", + "version": "v0.12.42", "source": { "type": "git", "url": "https://github.com/swaggest/php-json-schema.git", - "reference": "1bb97901314f828774dd8c5b21bff889ce0b34bb" + "reference": "d23adb53808b8e2da36f75bc0188546e4cbe3b45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/php-json-schema/zipball/1bb97901314f828774dd8c5b21bff889ce0b34bb", - "reference": "1bb97901314f828774dd8c5b21bff889ce0b34bb", + "url": "https://api.github.com/repos/swaggest/php-json-schema/zipball/d23adb53808b8e2da36f75bc0188546e4cbe3b45", + "reference": "d23adb53808b8e2da36f75bc0188546e4cbe3b45", "shasum": "" }, "require": { @@ -1088,9 +1088,9 @@ "support": { "email": "vearutop@gmail.com", "issues": "https://github.com/swaggest/php-json-schema/issues", - "source": "https://github.com/swaggest/php-json-schema/tree/v0.12.41" + "source": "https://github.com/swaggest/php-json-schema/tree/v0.12.42" }, - "time": "2022-08-17T11:21:43+00:00" + "time": "2023-09-12T14:43:42+00:00" }, { "name": "swaggest/json-schema-maker", @@ -1144,16 +1144,16 @@ }, { "name": "swaggest/php-code-builder", - "version": "v0.2.39", + "version": "v0.2.41", "source": { "type": "git", "url": "https://github.com/swaggest/php-code-builder.git", - "reference": "57f9213891a12707bc137bed91a88f996e11bd68" + "reference": "2f6ad5057c14d4842cf8b35d929a4b0813da39f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swaggest/php-code-builder/zipball/57f9213891a12707bc137bed91a88f996e11bd68", - "reference": "57f9213891a12707bc137bed91a88f996e11bd68", + "url": "https://api.github.com/repos/swaggest/php-code-builder/zipball/2f6ad5057c14d4842cf8b35d929a4b0813da39f5", + "reference": "2f6ad5057c14d4842cf8b35d929a4b0813da39f5", "shasum": "" }, "require": { @@ -1189,9 +1189,9 @@ ], "support": { "issues": "https://github.com/swaggest/php-code-builder/issues", - "source": "https://github.com/swaggest/php-code-builder/tree/v0.2.39" + "source": "https://github.com/swaggest/php-code-builder/tree/v0.2.41" }, - "time": "2023-08-03T22:33:56+00:00" + "time": "2023-12-19T00:40:11+00:00" }, { "name": "swaggest/rest-client", @@ -3033,5 +3033,5 @@ "platform-overrides": { "php": "5.6.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/examples/foobar-oas3.md b/examples/foobar-oas3.md index c74f922..a53a27d 100644 --- a/examples/foobar-oas3.md +++ b/examples/foobar-oas3.md @@ -11,23 +11,23 @@ configurations. * [Security](#security) * [Operations](#operations) - * Place + * ### Place - [DELETE `/places`](#deleteplaces) Delete Place - [GET `/places`](#getplaces) Find Place - [POST `/places`](#postplaces) Create Place - * Foo + * ### Foo - [DELETE `/foos`](#deletefoos) Delete Foo - [GET `/foos`](#getfoos) Find Foo - [POST `/foos`](#postfoos) Create Foo - [PUT `/foos`](#putfoos) Update Foo - * Lie + * ### Lie - [POST `/internal/find-available-carrots/{mille}/{look}`](#postinternalfindavailablecarrotsmillelook) Find Available Carrots - [GET `/lies`](#getlies) Get Lies - [GET `/lies/{id}`](#getliesid) Get Lie By ID - * LieAreas + * ### LieAreas - [GET `/lie-areas`](#getlieareas) List Lie areas name - [POST `/lie-areas`](#postlieareas) Create Lie Areas - [PUT `/lie-areas/{mille}/{LieArea}/sync`](#putlieareasmillelieareasync) Sync Lie Area diff --git a/examples/js-client/advanced-oas3/client.js b/examples/js-client/advanced-oas3/client.js index fc616d1..4566564 100644 --- a/examples/js-client/advanced-oas3/client.js +++ b/examples/js-client/advanced-oas3/client.js @@ -75,10 +75,10 @@ /** * File Upload With 'multipart/form-data' - * @param {PostFileUploadRequest} req - request parameters. + * @param {ExamplesAdvancedFileUploaderRequest} req - request parameters. * @param {AdvancedInfoCallback} onOK */ - APIClient.prototype.postFileUpload = function (req, onOK) { + APIClient.prototype.examplesAdvancedFileUploader = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -122,10 +122,10 @@ /** * direct Gzip - * @param {GetGzipPassThroughRequest} req - request parameters. + * @param {ExamplesAdvancedDirectGzipRequest} req - request parameters. * @param {AdvancedGzipPassThroughStructCallback} onOK */ - APIClient.prototype.getGzipPassThrough = function (req, onOK) { + APIClient.prototype.examplesAdvancedDirectGzip = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -204,10 +204,10 @@ * Request With JSON Body and non-trivial validation * Request with JSON body and query/header/path params, response with JSON * body and data from request. - * @param {PostJsonBodyValidationInPathRequest} req - request parameters. + * @param {Propertyd41d8cRequest} req - request parameters. * @param {AdvancedOutputWithJSONType3Callback} onOK */ - APIClient.prototype.postJsonBodyValidationInPath = function (req, onOK) { + APIClient.prototype.propertyd41d8c = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -252,10 +252,10 @@ * Request With JSON Body * Request with JSON body and query/header/path params, response with JSON * body and data from request. - * @param {PostJsonBodyInPathRequest} req - request parameters. + * @param {ExamplesAdvancedJsonBodyRequest} req - request parameters. * @param {AdvancedOutputWithJSONType2Callback} onCreated */ - APIClient.prototype.postJsonBodyInPath = function (req, onCreated) { + APIClient.prototype.examplesAdvancedJsonBody = function (req, onCreated) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -299,10 +299,10 @@ /** * Request With JSON Map In Body * Request with JSON object (map) body. - * @param {PostJsonMapBodyRequest} req - request parameters. + * @param {ExamplesAdvancedJsonMapBodyRequest} req - request parameters. * @param {AdvancedJsonOutputType2Callback} onOK */ - APIClient.prototype.postJsonMapBody = function (req, onOK) { + APIClient.prototype.examplesAdvancedJsonMapBody = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -346,10 +346,10 @@ * Request With JSON Query Parameter * Request with JSON body and query/header/path params, response with JSON * body and data from request. - * @param {GetJsonParamInPathRequest} req - request parameters. + * @param {ExamplesAdvancedJsonParamRequest} req - request parameters. * @param {AdvancedOutputWithJSONCallback} onOK */ - APIClient.prototype.getJsonParamInPath = function (req, onOK) { + APIClient.prototype.examplesAdvancedJsonParam = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -390,10 +390,10 @@ /** * Request With JSON Array In Body - * @param {PostJsonSliceBodyRequest} req - request parameters. + * @param {ExamplesAdvancedJsonSliceBodyRequest} req - request parameters. * @param {AdvancedJsonOutputCallback} onOK */ - APIClient.prototype.postJsonSliceBody = function (req, onOK) { + APIClient.prototype.examplesAdvancedJsonSliceBody = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -546,10 +546,10 @@ /** * Request With Object As Query Parameter - * @param {GetQueryObjectRequest} req - request parameters. + * @param {ExamplesAdvancedQueryObjectRequest} req - request parameters. * @param {AdvancedOutputQueryObjectCallback} onOK */ - APIClient.prototype.getQueryObject = function (req, onOK) { + APIClient.prototype.examplesAdvancedQueryObject = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -585,10 +585,10 @@ * Request Response Mapping * This use case has transport concerns fully decoupled with external req/resp * mapping. - * @param {PostReqRespMappingRequest} req - request parameters. + * @param {ReqRespMappingRequest} req - request parameters. * @param {RawCallback} onNoContent */ - APIClient.prototype.postReqRespMapping = function (req, onNoContent) { + APIClient.prototype.reqRespMapping = function (req, onNoContent) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -627,10 +627,10 @@ /** * Validation * Input/Output with validation. Custom annotation. - * @param {PostValidationRequest} req - request parameters. + * @param {ExamplesAdvancedValidationRequest} req - request parameters. * @param {AdvancedOutputPortType2Callback} onOK */ - APIClient.prototype.postValidation = function (req, onOK) { + APIClient.prototype.examplesAdvancedValidation = function (req, onOK) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { diff --git a/examples/js-client/advanced-oas3/jsdoc.js b/examples/js-client/advanced-oas3/jsdoc.js index 6644392..a99f56a 100644 --- a/examples/js-client/advanced-oas3/jsdoc.js +++ b/examples/js-client/advanced-oas3/jsdoc.js @@ -27,7 +27,7 @@ */ /** - * @typedef PostFileUploadRequest + * @typedef ExamplesAdvancedFileUploaderRequest * @type {Object} * @property {Number} inQuery - Simple scalar value in query. * @property {String} simple - Simple scalar value in body. @@ -53,7 +53,7 @@ */ /** - * @typedef GetGzipPassThroughRequest + * @typedef ExamplesAdvancedDirectGzipRequest * @type {Object} * @property {Boolean} plainStruct - Output plain structure instead of gzip container. * @property {Boolean} countItems - Invokes internal decoding of compressed data. @@ -91,7 +91,7 @@ */ /** - * @typedef PostJsonBodyValidationInPathRequest + * @typedef Propertyd41d8cRequest * @type {Object} * @property {Number} inQuery - Simple scalar value in query. * @property {String} inPath - Simple scalar value in path. @@ -122,7 +122,7 @@ */ /** - * @typedef PostJsonBodyInPathRequest + * @typedef ExamplesAdvancedJsonBodyRequest * @type {Object} * @property {String} inQuery - Simple scalar value in query. * @property {String} inPath - Simple scalar value in path. @@ -146,7 +146,7 @@ */ /** - * @typedef PostJsonMapBodyRequest + * @typedef ExamplesAdvancedJsonMapBodyRequest * @type {Object} * @property {Number} inQuery - Simple scalar value in query. * @property {String} xHeader - Simple scalar value in header. @@ -175,7 +175,7 @@ */ /** - * @typedef GetJsonParamInPathRequest + * @typedef ExamplesAdvancedJsonParamRequest * @type {Object} * @property {Number} inQuery - Simple scalar value in query. * @property {AdvancedJSONPayload} identity - JSON value in query. @@ -199,7 +199,7 @@ */ /** - * @typedef PostJsonSliceBodyRequest + * @typedef ExamplesAdvancedJsonSliceBodyRequest * @type {Object} * @property {Number} inQuery - Simple scalar value in query. * @property {String} xHeader - Simple scalar value in header. @@ -245,7 +245,7 @@ */ /** - * @typedef GetQueryObjectRequest + * @typedef ExamplesAdvancedQueryObjectRequest * @type {Object} * @property {Object.} inQuery - Object value in query. */ @@ -262,7 +262,7 @@ */ /** - * @typedef PostReqRespMappingRequest + * @typedef ReqRespMappingRequest * @type {Object} * @property {String} xHeader - Simple scalar value. * @property {Number} val2 - Simple scalar value. @@ -281,7 +281,7 @@ */ /** - * @typedef PostValidationRequest + * @typedef ExamplesAdvancedValidationRequest * @type {Object} * @property {Boolean} q - This parameter will bypass explicit validation as it does not have constraints. * @property {Number} xInput - Request minimum: 10, response maximum: 20. diff --git a/examples/js-client/petstore-oas3/client.js b/examples/js-client/petstore-oas3/client.js index cffef73..773fd1c 100644 --- a/examples/js-client/petstore-oas3/client.js +++ b/examples/js-client/petstore-oas3/client.js @@ -91,11 +91,11 @@ /** * Creates a new pet in the store. Duplicates are allowed - * @param {PostPetsRequest} req - request parameters. + * @param {AddPetRequest} req - request parameters. * @param {NewPetPetAllOf1Callback} onOK * @param {ErrorCallback} onDefault */ - APIClient.prototype.postPets = function (req, onOK, onDefault) { + APIClient.prototype.addPet = function (req, onOK, onDefault) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -135,11 +135,11 @@ /** * Returns a user based on a single ID, if the user does not have access to * the pet - * @param {GetPetsIdRequest} req - request parameters. + * @param {FindPetByIdRequest} req - request parameters. * @param {NewPetPetAllOf1Callback} onOK * @param {ErrorCallback} onDefault */ - APIClient.prototype.getPetsId = function (req, onOK, onDefault) { + APIClient.prototype.findPetById = function (req, onOK, onDefault) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -174,11 +174,11 @@ /** * deletes a single pet based on the ID supplied - * @param {DeletePetsIdRequest} req - request parameters. + * @param {DeletePetRequest} req - request parameters. * @param {RawCallback} onNoContent * @param {ErrorCallback} onDefault */ - APIClient.prototype.deletePetsId = function (req, onNoContent, onDefault) { + APIClient.prototype.deletePet = function (req, onNoContent, onDefault) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { diff --git a/examples/js-client/petstore-oas3/jsdoc.js b/examples/js-client/petstore-oas3/jsdoc.js index e882cc4..06bb59a 100644 --- a/examples/js-client/petstore-oas3/jsdoc.js +++ b/examples/js-client/petstore-oas3/jsdoc.js @@ -38,7 +38,7 @@ */ /** - * @typedef PostPetsRequest + * @typedef AddPetRequest * @type {Object} * @property {NewPet} body */ @@ -49,13 +49,13 @@ */ /** - * @typedef GetPetsIdRequest + * @typedef FindPetByIdRequest * @type {Object} * @property {Number} id - ID of pet to fetch. */ /** - * @typedef DeletePetsIdRequest + * @typedef DeletePetRequest * @type {Object} * @property {Number} id - ID of pet to delete. */ diff --git a/examples/js-client/uspto-oas3/client.js b/examples/js-client/uspto-oas3/client.js index 918ab8b..6efef50 100644 --- a/examples/js-client/uspto-oas3/client.js +++ b/examples/js-client/uspto-oas3/client.js @@ -70,11 +70,11 @@ * the oa_citations. Please see the 'fields' attribute which returns an array * of field names. Each field or a combination of fields can be searched using * the syntax options shown below. - * @param {GetDatasetVersionFieldsRequest} req - request parameters. + * @param {ListSearchableFieldsRequest} req - request parameters. * @param {StringCallback} onOK * @param {StringCallback} onNotFound */ - APIClient.prototype.getDatasetVersionFields = function (req, onOK, onNotFound) { + APIClient.prototype.listSearchableFields = function (req, onOK, onNotFound) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -120,11 +120,11 @@ * https://lucene.apache.org/core/3_6_2/queryparsersyntax.html#Overview for * the query syntax. List of field names that are searchable can be determined * using above GET api. - * @param {PostDatasetVersionRecordsRequest} req - request parameters. + * @param {PerformSearchRequest} req - request parameters. * @param {ArrayObjectStringObjectCallback} onOK * @param {RawCallback} onNotFound */ - APIClient.prototype.postDatasetVersionRecords = function (req, onOK, onNotFound) { + APIClient.prototype.performSearch = function (req, onOK, onNotFound) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { diff --git a/examples/js-client/uspto-oas3/jsdoc.js b/examples/js-client/uspto-oas3/jsdoc.js index 38ff29e..42863e5 100644 --- a/examples/js-client/uspto-oas3/jsdoc.js +++ b/examples/js-client/uspto-oas3/jsdoc.js @@ -22,7 +22,7 @@ */ /** - * @typedef GetDatasetVersionFieldsRequest + * @typedef ListSearchableFieldsRequest * @type {Object} * @property {String} dataset - Name of the dataset. * @property {String} version - Version of the dataset. @@ -34,7 +34,7 @@ */ /** - * @typedef PostDatasetVersionRecordsRequest + * @typedef PerformSearchRequest * @type {Object} * @property {String} version - Version of the dataset. * @property {String} dataset - Name of the dataset. In this case, the default value is oa_citations. diff --git a/examples/js-client/xhprof-collector/client.js b/examples/js-client/xhprof-collector/client.js index ca83a67..6acdd8f 100644 --- a/examples/js-client/xhprof-collector/client.js +++ b/examples/js-client/xhprof-collector/client.js @@ -58,11 +58,11 @@ /** * Collect Profile * Collects XHPROF-compatible PHP profile. - * @param {XhPostProfileRequest} req - request parameters. + * @param {XhCollectProfileRequest} req - request parameters. * @param {RawCallback} onAccepted * @param {XhRestErrResponseCallback} onConflict */ - Backend.prototype.postProfile = function (req, onAccepted, onConflict) { + Backend.prototype.collectProfile = function (req, onAccepted, onConflict) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -103,11 +103,11 @@ /** * Dot Graph - * @param {XhGetProfileDotRequest} req - request parameters. + * @param {XhDotGraphRequest} req - request parameters. * @param {RawCallback} onOK * @param {XhRestErrResponseCallback} onNotFound */ - Backend.prototype.getProfileDot = function (req, onOK, onNotFound) { + Backend.prototype.dotGraph = function (req, onOK, onNotFound) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -155,11 +155,11 @@ /** * Find Symbol - * @param {XhGetProfileFindSymbolRequest} req - request parameters. + * @param {XhFindSymbolRequest} req - request parameters. * @param {XhSearchOutputCallback} onOK * @param {XhRestErrResponseCallback} onNotFound */ - Backend.prototype.getProfileFindSymbol = function (req, onOK, onNotFound) { + Backend.prototype.findSymbol = function (req, onOK, onNotFound) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -204,11 +204,11 @@ /** * Symbol Stat - * @param {XhGetProfileSymbolRequest} req - request parameters. + * @param {XhSymbolStatRequest} req - request parameters. * @param {XhSymbolStatOutputCallback} onOK * @param {XhRestErrResponseCallback} onNotFound */ - Backend.prototype.getProfileSymbol = function (req, onOK, onNotFound) { + Backend.prototype.symbolStat = function (req, onOK, onNotFound) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -251,11 +251,11 @@ /** * Top Traces * Get traces that occupy most of resource. - * @param {XhGetTopTracesRequest} req - request parameters. + * @param {XhTopTracesRequest} req - request parameters. * @param {ArrayXhTraceInfoCallback} onOK * @param {XhRestErrResponseCallback} onNotFound */ - Backend.prototype.getTopTraces = function (req, onOK, onNotFound) { + Backend.prototype.topTraces = function (req, onOK, onNotFound) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -305,11 +305,11 @@ * Upload Profile * Collects XHPROF-compatible PHP profile from uploaded JSON/PHP-Serialized * file. - * @param {XhPostUploadProfileRequest} req - request parameters. + * @param {XhUploadProfileRequest} req - request parameters. * @param {RawCallback} onAccepted * @param {XhRestErrResponseCallback} onConflict */ - Backend.prototype.postUploadProfile = function (req, onAccepted, onConflict) { + Backend.prototype.uploadProfile = function (req, onAccepted, onConflict) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { @@ -354,11 +354,11 @@ * Upload Profiles * Collects XHPROF-compatible PHP profiles from uploaded JSON/PHP-Serialized * files. - * @param {XhPostUploadProfilesRequest} req - request parameters. + * @param {XhUploadProfilesRequest} req - request parameters. * @param {RawCallback} onAccepted * @param {XhRestErrResponseCallback} onConflict */ - Backend.prototype.postUploadProfiles = function (req, onAccepted, onConflict) { + Backend.prototype.uploadProfiles = function (req, onAccepted, onConflict) { var x = new XMLHttpRequest(); x.onreadystatechange = function () { if (x.readyState !== XMLHttpRequest.DONE) { diff --git a/examples/js-client/xhprof-collector/jsdoc.js b/examples/js-client/xhprof-collector/jsdoc.js index 3ab60c9..c57e643 100644 --- a/examples/js-client/xhprof-collector/jsdoc.js +++ b/examples/js-client/xhprof-collector/jsdoc.js @@ -3,7 +3,7 @@ /** * @typedef XhAggregatorGroup * @type {Object} - * @property {Number} end - Interval end UTC unix timestamp. . + * @property {Number} end - Interval end UTC unix timestamp. * @property {String} id - Profile ID. * @property {?Object.} labels * @property {Number} start - Interval start UTC unix timestamp. @@ -58,7 +58,7 @@ */ /** - * @typedef XhPostProfileRequest + * @typedef XhCollectProfileRequest * @type {Object} * @property {XhCollectProfileInput} body */ @@ -83,7 +83,7 @@ */ /** - * @typedef XhGetProfileDotRequest + * @typedef XhDotGraphRequest * @type {Object} * @property {String} rootSymbol * @property {Number} graphLimit - Maximum number of nodes (symbols) in graph. @@ -92,7 +92,7 @@ */ /** - * @typedef XhGetProfileFindSymbolRequest + * @typedef XhFindSymbolRequest * @type {Object} * @property {XhAggregatorGroup} aggregate * @property {String} match - Substring to match in symbol. @@ -111,7 +111,7 @@ */ /** - * @typedef XhGetProfileSymbolRequest + * @typedef XhSymbolStatRequest * @type {Object} * @property {XhAggregatorGroup} aggregate * @property {String} symbol @@ -151,7 +151,7 @@ */ /** - * @typedef XhGetTopTracesRequest + * @typedef XhTopTracesRequest * @type {Object} * @property {String} rootSymbol * @property {XhAggregatorGroup} aggregate @@ -174,14 +174,14 @@ */ /** - * @typedef XhPostUploadProfileRequest + * @typedef XhUploadProfileRequest * @type {Object} * @property {?File|?Blob} profile * @property {Number} sample */ /** - * @typedef XhPostUploadProfilesRequest + * @typedef XhUploadProfilesRequest * @type {Object} * @property {?Array} profiles - Files with profile JSON data. */ diff --git a/examples/petstore-oas3.md b/examples/petstore-oas3.md index 9850677..0fb3256 100644 --- a/examples/petstore-oas3.md +++ b/examples/petstore-oas3.md @@ -7,7 +7,7 @@ Version: 1.0.0 A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification -Base URL:http://petstore.swagger.io/api +Base URL: http://petstore.swagger.io/api ## Table Of Contents diff --git a/examples/rhsm.md b/examples/rhsm.md index 18e9b6e..a7fe81d 100644 --- a/examples/rhsm.md +++ b/examples/rhsm.md @@ -8,13 +8,13 @@ Version: 1.264.0. Contact: https://access.redhat.com/support/cases/. -Base URL:https://api.access.redhat.com/management/v1 +Base URL: https://api.access.redhat.com/management/v1 ## Table Of Contents * [Security](#security) * [Operations](#operations) - * allocation + * ### allocation - [GET `/allocations`](#listallocations) List all allocations for a user - [POST `/allocations`](#postallocations) Create Satellite - [GET `/allocations/versions`](#getallocationsversions) List Satellite versions @@ -30,7 +30,7 @@ Base URL:https://api.access.redhat.com/management/v1 - [GET `/allocations/{uuid}/pools`](#getallocationsuuidpools) List all pools for an allocation - [DELETE `/allocations/{uuid}/{EntitlementID}`](#deleteallocationsuuidentitlementid) Remove entitlement from the allocation - * cloudaccess + * ### cloudaccess - [GET `/cloud_access_providers/enabled`](#getcloudaccessprovidersenabled) List all enabled cloud access providers for a user - [PUT `/cloud_access_providers/{ProviderShortName}/account`](#putcloudaccessprovidersprovidershortnameaccount) Update provider account - [POST `/cloud_access_providers/{ProviderShortName}/accounts`](#postcloudaccessprovidersprovidershortnameaccounts) Add accounts for a provider @@ -39,32 +39,32 @@ Base URL:https://api.access.redhat.com/management/v1 - [PUT `/cloud_access_providers/{ProviderShortName}/accounts/{AccountID}/verification`](#putcloudaccessprovidersprovidershortnameaccountsaccountidverification) Verify a provider account - [POST `/cloud_access_providers/{ProviderShortName}/goldimage`](#postcloudaccessprovidersprovidershortnamegoldimage) Enable Gold image access - * errata + * ### errata - [GET `/errata`](#geterrata) List all errata for a user's systems - [GET `/errata/cset/{ContentSet}/arch/{Arch}`](#geterratacsetcontentsetarcharch) Get all the errata for the specified content set and arch - [GET `/errata/{AdvisoryID}`](#geterrataadvisoryid) Get the details of an advisory - [GET `/errata/{AdvisoryID}/packages`](#geterrataadvisoryidpackages) List all packages for an advisory - [GET `/errata/{AdvisoryID}/systems`](#geterrataadvisoryidsystems) List all systems for an advisory - * images + * ### images - [GET `/images/cset/{ContentSet}`](#getimagescsetcontentset) List available images in a content set - [GET `/images/rhel/{Version}/{Arch}`](#getimagesrhelversionarch) List RHEL image downloads by version and architecture. - [GET `/images/{checksum}/download`](#getimageschecksumdownload) Download an image by its SHA256 checksum - * organization + * ### organization - [GET `/organization`](#getorganization) Get details of the user's organization - * packages + * ### packages - [GET `/packages/cset/{ContentSet}/arch/{Arch}`](#getpackagescsetcontentsetarcharch) Get all the packages for the specified content set and arch. - [GET `/packages/{Checksum}`](#getpackageschecksum) Get the details of a package - [GET `/packages/{checksum}/download`](#getpackageschecksumdownload) Download a package by its SHA256 checksum - * subscription + * ### subscription - [GET `/subscriptions`](#getsubscriptions) List all subscriptions for a user - [GET `/subscriptions/{SubscriptionNumber}/contentSets`](#getsubscriptionssubscriptionnumbercontentsets) List all content sets for a subscription - [GET `/subscriptions/{SubscriptionNumber}/systems`](#getsubscriptionssubscriptionnumbersystems) List all systems consuming a subscription - * system + * ### system - [GET `/systems`](#getsystems) List all systems for a user - [GET `/systems/{SystemUUID}`](#getsystemssystemuuid) Get a system specified by UUID. - [DELETE `/systems/{SystemUUID}`](#deletesystemssystemuuid) Remove system profile diff --git a/examples/uspto-oas3.md b/examples/uspto-oas3.md index b945693..0eb64c1 100644 --- a/examples/uspto-oas3.md +++ b/examples/uspto-oas3.md @@ -14,16 +14,16 @@ for the POST call is that it allows users to specify any complex search criteria without worry about the GET size limitations as well as encoding of the input parameters. -Base URL:{scheme}://developer.uspto.gov/ds-api +Base URL: {scheme}://developer.uspto.gov/ds-api ## Table Of Contents * [Operations](#operations) - * metadata + * ### metadata - [GET `/`](#listdatasets) List available data sets - [GET `/{dataset}/{version}/fields`](#getdatasetversionfields) Provides the general information about the API and the list of fields that can be used to query the dataset. - * search + * ### search - [POST `/{dataset}/{version}/records`](#postdatasetversionrecords) Provides search capability for the data set with the given search criteria. * [Types](#types) diff --git a/examples/xhprof-collector.md b/examples/xhprof-collector.md index 7cb97fb..45fdd5a 100644 --- a/examples/xhprof-collector.md +++ b/examples/xhprof-collector.md @@ -9,14 +9,14 @@ Version: cli-mode ## Table Of Contents * [Operations](#operations) - * Analyze + * ### Analyze - [GET `/profile`](#listprofiles) List Profiles - [GET `/profile.dot`](#getprofiledot) Dot Graph - [GET `/profile/find-symbol`](#getprofilefindsymbol) Find Symbol - [GET `/profile/symbol`](#getprofilesymbol) Symbol Stat - [GET `/top-traces`](#gettoptraces) Top Traces - * Collect + * ### Collect - [POST `/profile`](#postprofile) Collect Profile - [POST `/upload/profile`](#postuploadprofile) Upload Profile - [POST `/upload/profiles`](#postuploadprofiles) Upload Profiles @@ -163,7 +163,7 @@ Collects XHPROF-compatible PHP profiles from uploaded JSON/PHP-Serialized files. |Property|Type |Description | |--------|----------------------------|----------------------------------| -|`end` |`Number` |Interval end UTC unix timestamp. .| +|`end` |`Number` |Interval end UTC unix timestamp. | |`id` |`String` |Profile ID. | |`labels`|`Map`, `null`| | |`start` |`Number` |Interval start UTC unix timestamp.| diff --git a/src/Command/App.php b/src/Command/App.php index e880a60..04f1e06 100644 --- a/src/Command/App.php +++ b/src/Command/App.php @@ -7,7 +7,7 @@ class App extends Command\Application { - static $ver = 'v0.1.33'; + static $ver = 'v0.1.34'; public $phpGuzzleClient; public $goClient; diff --git a/src/JavaScript/Client/Client.php b/src/JavaScript/Client/Client.php index 37d3a2a..fb1fdeb 100644 --- a/src/JavaScript/Client/Client.php +++ b/src/JavaScript/Client/Client.php @@ -105,7 +105,7 @@ public function addOperation(Operation $operation) $funcName = $this->makeName($operation->operationId); } - if (empty($funcName) || isset($this->operationNames)) { + if (empty($funcName) || isset($this->operationNames[$funcName])) { $funcName = $this->makeName($operation->method . '_' . $operation->path); } diff --git a/src/Markdown/APIDoc.php b/src/Markdown/APIDoc.php index 832a486..6d4b93c 100644 --- a/src/Markdown/APIDoc.php +++ b/src/Markdown/APIDoc.php @@ -69,7 +69,7 @@ public function setConfig(Config $config) $headComment .= trim(wordwrap($config->description)) . "\n\n"; } if (isset($config->baseUrl) && !empty(trim($config->baseUrl))) { - $headComment .= 'Base URL:' . trim(wordwrap($config->baseUrl)) . "\n\n"; + $headComment .= 'Base URL: ' . trim(wordwrap($config->baseUrl)) . "\n\n"; } if (isset($this->addSchemaUrl) && !empty($this->addSchemaUrl)) { $headComment .= '[Schema](' . $this->addSchemaUrl . ').' . "\n\n"; @@ -333,7 +333,7 @@ public function store($path) { foreach ($this->taggedContents as $tag => $content) { $this->tableOfContents->addSnippet(<<