Skip to content

Commit

Permalink
Merge pull request #1014 from appwrite/feat-route-muliplexing
Browse files Browse the repository at this point in the history
Implement SDK Method Multiplexing
  • Loading branch information
abnegate authored Feb 4, 2025
2 parents f0d2ea2 + 271f2d1 commit d288013
Show file tree
Hide file tree
Showing 16 changed files with 355 additions and 260 deletions.
239 changes: 146 additions & 93 deletions composer.lock

Large diffs are not rendered by default.

338 changes: 209 additions & 129 deletions src/Spec/Swagger2.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {

{% for method in service.methods %}
/**
* {{ method.title }}
*
* {{ method.description | raw | replace({"\n": "", "\r": ""}) }}
*
{%~ for parameter in method.parameters.all %}
Expand Down Expand Up @@ -185,8 +183,6 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {

{%~ if method.responseModel | hasGenericType(spec) %}
/**
* {{ method.title }}
*
* {{ method.description | raw | replace({"\n": "", "\r": ""}) }}
*
{%~ for parameter in method.parameters.all %}
Expand Down
4 changes: 0 additions & 4 deletions templates/apple/Sources/Services/Service.swift.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ open class {{ service.name | caseUcfirst | overrideIdentifier }}: Service {

{%~ for method in service.methods %}
///
/// {{ method.title }}
///
{%~ if method.description %}
{{~ method.description | swiftComment }}
///
Expand Down Expand Up @@ -75,8 +73,6 @@ open class {{ service.name | caseUcfirst | overrideIdentifier }}: Service {
}
{%~ if method.responseModel | hasGenericType(spec) %}

///
/// {{ method.title }}
///
{%~ if method.description %}
{{~ method.description | swiftComment }}
Expand Down
2 changes: 0 additions & 2 deletions templates/dart/lib/services/service.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class {{ service.name | caseUcfirst }} extends Service {
{{ service.name | caseUcfirst }}(super.client);
{% for method in service.methods %}

/// {{ method.title }}
///
{%~ if method.description %}
{{ method.description | dartComment }}
{% endif %}
Expand Down
2 changes: 0 additions & 2 deletions templates/deno/src/services/service.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export class {{ service.name | caseUcfirst }} extends Service {
{% set generics = _self.get_generics(spec.definitions[method.responseModel], spec, true, true) %}
{% set generics_return = _self.get_generics_return(spec.definitions[method.responseModel], spec) %}
/**
* {{ method.title }}
*
{% if method.description %}
{{ method.description|comment1 }}
*
Expand Down
4 changes: 0 additions & 4 deletions templates/dotnet/Package/Services/ServiceTemplate.cs.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ namespace {{ spec.title | caseUcfirst }}.Services
}

{%~ for method in service.methods %}
{%~ if method.title %}
/// <summary>
/// {{ method.title }}
{%~ endif %}
{%~ if method.description %}
/// <para>
{{~ method.description | dotnetComment }}
Expand Down
2 changes: 0 additions & 2 deletions templates/flutter/lib/services/service.dart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class {{ service.name | caseUcfirst }} extends Service {
{{ service.name | caseUcfirst }}(super.client);
{% for method in service.methods %}

/// {{ method.title }}
///
{%~ if method.description %}
{{ method.description|dartComment }}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {

{% for method in service.methods %}
/**
* {{ method.title }}
*
* {{ method.description | raw | replace({"\n": "", "\r": ""}) }}
*
{%~ for parameter in method.parameters.all %}
Expand Down Expand Up @@ -86,8 +84,6 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
{%~ if method.responseModel | hasGenericType(spec) %}

/**
* {{ method.title }}
*
* {{ method.description | raw | replace({"\n": "", "\r": ""}) }}
*
{%~ for parameter in method.parameters.all %}
Expand Down
2 changes: 0 additions & 2 deletions templates/node/src/services/template.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export class {{ service.name | caseUcfirst }} {

{%~ for method in service.methods %}
/**
* {{ method.title }}
*
{%~ if method.description %}
* {{ method.description }}
{%~ endif %}
Expand Down
1 change: 0 additions & 1 deletion templates/php/docs/service.md.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# {{ service.name | caseUcfirst }} Service

{% for method in service.methods %}
## {{ method.title }}

```http request
{{ method.method | caseUpper }} {{ spec.endpoint }}{{ method.path }}
Expand Down
2 changes: 0 additions & 2 deletions templates/php/src/Services/Service.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class {{ service.name | caseUcfirst }} extends Service
{% for method in service.methods %}
/**
* {{ method.title }}
*
{% if method.description %}
{{ method.description|comment1 }}
*
Expand Down
3 changes: 0 additions & 3 deletions templates/python/package/services/service.py.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ class {{ service.name | caseUcfirst }}(Service):
{% for method in service.methods %}

def {{ method.name | caseSnake }}(self{% if method.parameters.all|length > 0 %}, {% endif %}{% for parameter in method.parameters.all %}{{ parameter.name | escapeKeyword | caseSnake }}{% if not parameter.required %} = None{% endif %}{% if not loop.last %}, {% endif %}{% endfor %}{% if 'multipart/form-data' in method.consumes %}, on_progress = None{% endif %}):
{% if method.title %}
"""{{ method.title }}"""

{% endif %}
api_path = '{{ method.path }}'
{{ include('python/base/params.twig') }}
{% if 'multipart/form-data' in method.consumes %}
Expand Down
2 changes: 0 additions & 2 deletions templates/react-native/src/services/template.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export class {{ service.name | caseUcfirst }} extends Service {
{% for method in service.methods %}

/**
* {{ method.title }}
*
{% if method.description %}
{{ method.description|comment2 }}
{% endif %}
Expand Down
4 changes: 0 additions & 4 deletions templates/swift/Sources/Services/Service.swift.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ open class {{ service.name | caseUcfirst | overrideIdentifier }}: Service {

{%~ for method in service.methods %}
///
/// {{ method.title }}
///
{%~ if method.description %}
{{~ method.description | swiftComment }}
///
Expand Down Expand Up @@ -72,8 +70,6 @@ open class {{ service.name | caseUcfirst | overrideIdentifier }}: Service {
}
{%~ if method.responseModel | hasGenericType(spec) %}

///
/// {{ method.title }}
///
{%~ if method.description %}
{{~ method.description | swiftComment }}
Expand Down
2 changes: 0 additions & 2 deletions templates/web/src/services/template.ts.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export class {{ service.name | caseUcfirst }} {

{%~ for method in service.methods %}
/**
* {{ method.title }}
*
{%~ if method.description %}
* {{ method.description }}
{%~ endif %}
Expand Down

0 comments on commit d288013

Please sign in to comment.