You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -626,7 +618,7 @@ At the time of compiling this comparison, the Speakeasy SDK required at least PH
626
618
627
619
Seeing as PHP 8.1 has stopped receiving security updates we recommend updating to use the latest PHP version regardless of the SDK being used, but when the SDK is being used by external customers it's important to consider the lowest PHP version supported.
628
620
629
-
## Strict typing
621
+
## Type system
630
622
631
623
Both tools create DocBlocks to provide type annotations to all parameters and variables in the SDKs, which is useful for IDEs and for programmers to understand the code.
632
624
@@ -730,28 +722,6 @@ class BookingPayment implements ModelInterface, ArrayAccess, \JsonSerializable
730
722
731
723
You can see how much more verbose and complex the OpenAPI Generator code is compared to Speakeasy's use of enums.
732
724
733
-
### Content types
734
-
735
-
Below are the content types in the schema for creating a booking, in JSON, XML, or as a form.
736
-
737
-
```yaml
738
-
requestBody:
739
-
content:
740
-
application/json:
741
-
schema:
742
-
$ref: "#/components/schemas/Booking"
743
-
application/xml:
744
-
schema:
745
-
$ref: "#/components/schemas/Booking"
746
-
application/x-www-form-urlencoded:
747
-
schema:
748
-
$ref: "#/components/schemas/Booking"
749
-
```
750
-
751
-
Speakeasy supports JSON and form content types, but not XML. OpenAPI Generator supports all three.
752
-
753
-
In Speakeasy, each content type for each operation will become its own file in the SDK. In OpenAPI Generator, all operations are combined into one API file.
754
-
755
725
### Unions
756
726
757
727
In OpenAPI, you can use `oneOf` in a schema like this:
@@ -785,6 +755,35 @@ class User
785
755
786
756
OpenAPI Generator can handle this schema, but creates a 380-line file called `UserAge.php` with custom code to implement unions.
787
757
758
+
## Asynchronous calls
759
+
760
+
Both Speakeasy and OpenAPI Generator support asynchronous HTTP calls, but they implement them differently.
761
+
762
+
Speakeasy: `getStation`and `getStationAsync`.
763
+
OpenAPI Generator `AddPet` and `AddPetAsync`.
764
+
765
+
## Content types
766
+
767
+
Below are the content types in the schema for creating a booking, in JSON, XML, or as a form.
768
+
769
+
```yaml
770
+
requestBody:
771
+
content:
772
+
application/json:
773
+
schema:
774
+
$ref: "#/components/schemas/Booking"
775
+
application/xml:
776
+
schema:
777
+
$ref: "#/components/schemas/Booking"
778
+
application/x-www-form-urlencoded:
779
+
schema:
780
+
$ref: "#/components/schemas/Booking"
781
+
```
782
+
783
+
Speakeasy supports JSON and form content types, but not XML. OpenAPI Generator supports all three.
784
+
785
+
In Speakeasy, each content type for each operation will become its own file in the SDK. In OpenAPI Generator, all operations are combined into one API file.
786
+
788
787
## Created documentation
789
788
790
789
Both Speakeasy and OpenAPI Generator create a `docs` directory with Markdown documentation and PHP usage examples for every operation and every model. Unfortunately despite the formatting not looking to great to the eye of the beholder, there are two syntax errors in here which will need to be fixed before trying to run this code. Can you spot them?
0 commit comments