Skip to content

Commit d80d356

Browse files
committed
Sync open source content 🐝 (from 7952eb7db1acf0b4d89b8a3d6da43938c1d15ce8)
1 parent cd5aea8 commit d80d356

File tree

5 files changed

+999
-123
lines changed

5 files changed

+999
-123
lines changed

api-design/developer-experience.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ import stripe
3535
stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
3636

3737
intent = stripe.PaymentIntent.create(
38-
amount=1000,
39-
currency="usd",
40-
payment_method_types=["card"],
38+
amount=1000,
39+
currency="usd",
40+
payment_method_types=["card"],
4141
)
42-
```
42+
43+
````
4344

4445
</div>
4546
<div className="md:w-1/2">
@@ -57,7 +58,8 @@ data = {
5758
}
5859
response = requests.post(url, headers=headers, data=data)
5960
print(response.json())
60-
```
61+
````
62+
6163
</div>
6264
</div>
6365

@@ -103,7 +105,7 @@ Understanding the audience is the first step to creating an API that meets their
103105
The difference between a good and bad API often comes down to onboarding. Just ask [@levelsio](https://x.com/levelsio/status/1853774638473437451), who compared xAI and Google Gemini's APIs:
104106

105107
<div className="mx-auto max-w-md">
106-
![levelsio tweet](./assets/twitter-levels-screenshot.png)
108+
![levelsio tweet](./assets/twitter-levels-screenshot.png)
107109
</div>
108110

109111
While xAI needed only an API key, Google Gemini required multiple sign-ups, portal logins, and complex installation steps. For enterprise teams, inconsistent authentication across endpoints or juggling multiple keys can be equally frustrating.
@@ -148,7 +150,7 @@ Think of the dashboard as more than just a control panel, it's a trust-building
148150

149151
The foundation of great developer experience is a well-designed, intuitive API. No amount of documentation or tooling can compensate for an overcomplicated API design.
150152

151-
REST is *almost* always the right choice for an API. While alternatives like [GraphQL](https://graphql.org/) offer powerful features, they also introduce complexity that most applications don't need. Unless there are specific use-cases that demand more flexibility, stick with REST - it's well-understood, widely supported, and gets the job done.
153+
REST is _almost_ always the right choice for an API. While alternatives like [GraphQL](https://graphql.org/) offer powerful features, they also introduce complexity that most applications don't need. Unless there are specific use-cases that demand more flexibility, stick with REST - it's well-understood, widely supported, and gets the job done.
152154

153155
Remember, most people don't need the engineering patterns used by tech giants. Start simple, and only add complexity when real usage demands it. The goal is to make life easier for developers, not to just to have fun playing around with the latest architectural patterns.
154156

docs/customize/code/code-regions/java.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ java:
2222
The Speakeasy examples repository has a [full example](https://github.com/speakeasy-api/examples/tree/main/customcode-sdkclasses-java) of a Java SDK
2323
that uses custom code regions.
2424

25-
2625
## Regions
2726

2827
Below are the available code regions in Java SDKs.
@@ -31,12 +30,12 @@ Below are the available code regions in Java SDKs.
3130

3231
Java SDK classes can have two code regions:
3332

34-
* `// #region imports` - allows the addition of imports to an SDK file needed for
35-
custom methods and properties. This region must be located at the top of the
36-
file alongside generated imports.
37-
* `// #region sdk-class-body` - allows the addition of custom methods and
38-
properties to an SDK class. This region must be located in the body of a Java
39-
SDK class alongside generated methods and properties.
33+
- `// #region imports` - allows the addition of imports to an SDK file needed for
34+
custom methods and properties. This region must be located at the top of the
35+
file alongside generated imports.
36+
- `// #region sdk-class-body` - allows the addition of custom methods and
37+
properties to an SDK class. This region must be located in the body of a Java
38+
SDK class alongside generated methods and properties.
4039

4140
## Managing dependencies
4241

@@ -102,4 +101,4 @@ public class Todos implements
102101
...
103102
}
104103
}
105-
```
104+
```

docs/customize/code/code-regions/overview.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ title: Custom code regions
33
description: "Learn how to use custom code regions to generate code in a specific location."
44
---
55

6-
import { Callout } from "@/mdx/components";
6+
import { Callout } from "@/mdx/components";
77

88
# Custom code regions
99

10-
11-
1210
<Callout title="Availability" type="info">
1311
Custom code regions are only available for [Enterprise users](/pricing).
1412
Custom code regions must be enabled in `settings/billing` under the account.

0 commit comments

Comments
 (0)