Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix operation names in JS, improve Markdown formatting #48

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
54 changes: 27 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/foobar-oas3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 20 additions & 20 deletions examples/js-client/advanced-oas3/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Loading
Loading