-
Notifications
You must be signed in to change notification settings - Fork 2
🌿 Fern Scribe: Add a comprehensive list of all extension headers... #303
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,55 @@ groups: | |
## SDK Configuration Options | ||
|
||
<ParamField path="additional_init_exports" type="array" default="null" required={false} toc={true}> | ||
Additional exports to include in the package's __init__.py file. | ||
</ParamField> | ||
|
||
<ParamField path="client" type="object" default="{}" required={false} toc={true}> | ||
Configuration for the generated client class and file structure. | ||
|
||
```yaml | ||
config: | ||
client: | ||
filename: "my_client.py" | ||
class_name: "MyClient" | ||
exported_filename: "my_client.py" | ||
exported_class_name: "MyClient" | ||
``` | ||
</ParamField> | ||
|
||
<ParamField path="client.filename" type="string" default="client.py" required={false} toc={true}> | ||
The filename for the generated client file. | ||
</ParamField> | ||
|
||
<ParamField path="client.class_name" type="string" default="null" required={false} toc={true}> | ||
The name of the generated client class. | ||
</ParamField> | ||
|
||
<ParamField path="client.exported_filename" type="string" default="client.py" required={false} toc={true}> | ||
The filename of the exported client which will be used in code snippets. | ||
</ParamField> | ||
|
||
<ParamField path="client.exported_class_name" type="string" default="null" required={false} toc={true}> | ||
The name of the exported client class that will be used in code snippets. | ||
</ParamField> | ||
|
||
<ParamField path="default_bytes_stream_chunk_size" type="number" default="null" required={false} toc={true}> | ||
The chunk size to use (if any) when processing a response bytes stream within `iter_bytes` or `aiter_bytes` results in: `for chunk in response.iter_bytes(chunk_size=<default_bytes_stream_chunk_size>):` | ||
</ParamField> | ||
|
||
<ParamField path="exclude_types_from_init_exports" type="bool" default="false" required={false} toc={true}> | ||
Whether to exclude type definitions from the package's __init__.py exports. | ||
</ParamField> | ||
|
||
<ParamField path="extension_headers" type="object" default="{}" required={false} toc={true}> | ||
Headers to inject into all requests made by the client. Useful for custom authentication or tracking. | ||
|
||
```yaml | ||
config: | ||
extension_headers: | ||
x-custom-header: "custom-value" | ||
x-api-key: "default-key" | ||
``` | ||
</ParamField> | ||
|
||
<ParamField path="extra_dependencies" type="object" default="{}" required={false} toc={true}> | ||
|
@@ -40,27 +82,31 @@ groups: | |
</ParamField> | ||
|
||
<ParamField path="extra_dev_dependencies" type="object" default="{}" required={false} toc={true}> | ||
Additional development dependencies to include in the generated package. | ||
</ParamField> | ||
|
||
<ParamField path="extras" type="object" default="{}" required={false} toc={true}> | ||
Optional feature groups that can be installed with the package. | ||
</ParamField> | ||
|
||
<ParamField path="flat_layout" type="bool" default="false" required={false} toc={true}> | ||
Whether to generate a flat file structure instead of nested directories. | ||
</ParamField> | ||
|
||
<ParamField path="follow_redirects_by_default" type="bool" default="true" required={false} toc={true}> | ||
Whether to follow redirects by default in HTTP requests. | ||
</ParamField> | ||
|
||
<ParamField path="improved_imports" type="bool" default="true" required={false} toc={true}> | ||
Feature flag that improves imports in the Python SDK by removing nested `resources` directory | ||
Feature flag that improves imports in the Python SDK by removing nested `resources` directory. | ||
</ParamField> | ||
|
||
<ParamField path="include_legacy_wire_tests" type="bool" default="false" required={false} toc={true}> | ||
Whether or not to include legacy wire tests in the generated SDK | ||
Whether or not to include legacy wire tests in the generated SDK. | ||
</ParamField> | ||
|
||
<ParamField path="include_union_utils" type="bool" default="false" required={false} toc={true}> | ||
Whether to include utility functions for working with union types. | ||
</ParamField> | ||
|
||
<ParamField path="inline_path_params" type="bool" default="false" required={false} toc={true}> | ||
|
@@ -72,26 +118,18 @@ groups: | |
</ParamField> | ||
|
||
<ParamField path="package_name" type="string" default="null" required={false} toc={true}> | ||
|
||
Specifies the Python package name that users will import your generated client | ||
from. | ||
Specifies the Python package name that users will import your generated client from. | ||
|
||
For example, setting `package_name: "my_custom_package"` enables users to use | ||
`my_custom_package import Client` to import your client: | ||
For example, setting `package_name: "my_custom_package"` enables users to use `from my_custom_package import Client` to import your client: | ||
|
||
```yaml {7-10} | ||
default-group: local | ||
groups: | ||
local: | ||
generators: | ||
- name: fernapi/fern-python | ||
version: 0.7.1 | ||
config: | ||
package_name: "my_custom_package" | ||
``` | ||
```yaml | ||
config: | ||
package_name: "my_custom_package" | ||
``` | ||
</ParamField> | ||
|
||
<ParamField path="pydantic_config" type="SdkPydanticModelCustomConfig" default="SdkPydanticModelCustomConfig()" required={false} toc={true}> | ||
<ParamField path="pydantic_config" type="object" default="{}" required={false} toc={true}> | ||
Configuration options for Pydantic model generation. | ||
</ParamField> | ||
|
||
<ParamField path="pydantic_config.include_union_utils" type="bool" default="false" required={false} toc={true}> | ||
|
@@ -140,20 +178,23 @@ groups: | |
</ParamField> | ||
|
||
<ParamField path="pyproject_toml" type="string" default="null" required={false} toc={true}> | ||
Custom pyproject.toml content to include in the generated package. | ||
</ParamField> | ||
|
||
<ParamField path="should_generate_websocket_clients" type="bool" default="false" required={false} toc={true}> | ||
Feature flag that enables generation of Python websocket clients. | ||
</ParamField> | ||
|
||
<ParamField path="skip_formatting" type="bool" default="false" required={false} toc={true}> | ||
Whether to skip code formatting of the generated files. | ||
</ParamField> | ||
|
||
<ParamField path="timeout_in_seconds" type="number | 'infinity'" default="60" required={false} toc={true}> | ||
By default, the generator generates a client that times out after 60 seconds. You can customize this value by providing a different number or setting to `infinity` to get rid of timeouts. | ||
</ParamField> | ||
|
||
<ParamField path="use_api_name_in_package" type="bool" default="false" required={false} toc={true}> | ||
Whether to include the API name in the generated package name. | ||
</ParamField> | ||
|
||
<ParamField path="use_inheritance_for_extended_models" type="bool" default="true" required={false} toc={true}> | ||
|
@@ -166,32 +207,4 @@ groups: | |
|
||
<ParamField path="use_typeddict_requests_for_file_upload" type="bool" default="false" required={false} toc={true}> | ||
Whether or not to generate TypedDicts instead of Pydantic Models for file upload request objects. Note that this flag was only introduced due to an oversight in the `use_typeddict_requests` flag implementation; it should be removed in the future. | ||
</ParamField> | ||
|
||
### client | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fern scribe removed this separate section. I think the document/more reasable is better with the separate section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also kind of a weird change because the |
||
Configuration for the generated client class and file structure. | ||
|
||
```yaml | ||
config: | ||
client: | ||
filename: "my_client.py" | ||
class_name: "MyClient" | ||
exported_filename: "my_client.py" | ||
exported_class_name: "MyClient" | ||
``` | ||
|
||
<ParamField path="filename" type="string" default="client.py" required={false} toc={true}> | ||
The filename for the generated client file. | ||
</ParamField> | ||
|
||
<ParamField path="class_name" type="string" default="null" required={false} toc={true}> | ||
The name of the generated client class. | ||
</ParamField> | ||
|
||
<ParamField path="exported_filename" type="string" default="client.py" required={false} toc={true}> | ||
The filename of the exported client which will be used in code snippets. | ||
</ParamField> | ||
|
||
<ParamField path="exported_class_name" type="string" default="null" required={false} toc={true}> | ||
The name of the exported client class that will be used in code snippets. | ||
</ParamField> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed highlighting? Not sure why, highlighting would be useful for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original text had an explanation of what the example was doing. Retaining the specific explanation or even moving it to a comment in the code block would be better. I like that fern scribe added a general definition of the extension, though.