SDK Updates: v1.0.0 - #32
Open
postman[bot] wants to merge 1 commit into
Open
Conversation
postman
Bot
force-pushed
the
sdk-updates
branch
3 times, most recently
from
June 8, 2026 13:11
e072c81 to
0d838e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDK updates
Added
.github/workflows/release.ymlworkflow for automated releases and PyPI publishing. Publishing is enabled by default; the release workflow's first step skips publishing—succeeding, not failing—when thePYPI_API_TOKENrepository secret is not set, andpublishing.releaseBranchin the generate request selects the trigger branchsdk.my_graphql_query(variables)in addition to service-level accessraw_graphqlescape hatch to execute custom GraphQL queries directly against the GraphQL endpointmodel_validate_partial()method for constructing model instances from recursive/pruned GraphQL response data without requiring all fields marked as required in the schemarelease.ymlrelease workflows now publish by default and no longer expose thepublishing.enabledrequest toggle; each workflow's first step skips publishing—succeeding, not failing—when its required registry secret (e.g.NPM_TOKEN,PYPI_API_TOKEN, Maven/GPG) is unset. Go and PHP need no registry secret and always publish (git tag + GitHub release).Authorizationheader per requestChanged
release.ymlrelease workflows now publish by default and no longer expose thepublishing.enabledrequest toggle; each workflow's first step skips publishing—succeeding, not failing—when its required registry secret (e.g.NPM_TOKEN,PYPI_API_TOKEN, Maven/GPG) is unset. Go and PHP need no registry secret and always publish (git tag + GitHub release).Fixed
pyproject.tomlrequirementNoneinstead of raising a PydanticValidationErrororApiErrorfrom typing import Anyis now emitted in every generated model file, fixingNameError: name 'Any' is not definedin complex (oneOf/anyOf) and error models_id) are now sanitized to a valid Pydantic field name (the original key is preserved on the wire via the field alias), fixing the "Fields must not use names with leading underscores" import errorField(pattern=...)with Python'sreengine instead of the default Rust engine, so patterns using look-ahead no longer crash model import with a regex parse errorfrom __future__ import annotations, enabling deferred evaluation of forward references in field annotations, so models with nested or cross-referenced types no longer raiseNameError: name <Model> is not definedat import timeAnyinstead of the lowercaseany, which resolved to the builtinany()and crashed@cast_modelswithTypeError: any() takes no keyword argumentsinteger/numberbut whose values aren't actually numeric (e.g.["1 - All", "2 - None"]) now generate astrenum instead of crashing at import withValueError: invalid literal for int()YYYY.MM.DDandYYYYMMDD) are now disambiguated instead of crashing withTypeError: Attempted to reuse keyapplication/octet-stream, file uploads) are now sent as raw data instead of being routed throughjson=, which crashed withTypeError: Object of type bytes is not JSON serializableTypeError: Subscripted generics cannot be used with class and instance checkswhen a field type is a subscripted generic (e.g.List[str],Dict[str, int]); the runtime origin type is used for theisinstancecheckcompanies({{companyId}})) are now correctly extracted and made available to generated SDK methodsAuthorizationwhen the resolved name is invalid, preventingHeaders.appendruntime errors in generated SDKshttps://protocol://server/api/versionfrom unresolved Postman variables) now parse correctly; the real base path is recoverable and requests route to the correct endpointAdded
.github/workflows/release.ymlworkflow for automated releases and PyPI publishing (controlled bypublishing.enabledandpublishing.releaseBranchin the generate request)Changed
https?://URL token and falling back gracefully when no URL can be foundFixed
skip-existing: trueto allow re-running workflows without failuretyping.Any-typed fields no longer raiseTypeErrorat runtime during validationgrpc://are preservedhttps://[2001:db8::1]/v1) to prevent validation errors; colon-heavy authorities that are not valid IPv6 literals now fall back to a placeholder instead of producing anInvalid IPv6 URLerrorContent-Type: application/jsonheader, so strict servers no longer reject them with HTTP 415Changed
models/__init__.pynow use PEP 562__getattr__for lazy loading; classes are imported on first access and cached rather than eagerly loaded at module-import time, significantly reducing startup time for SDKs with large model countsFixed
model_rebuild()is batched across all eligible BaseModels after all models are loaded into the module namespaceApiErrornow properly displays the HTTP status code and message when converted to a string or printed in tracebacks (previously showed only the class path)api_key_headerparameter with a placeholder value; the SDK's default header name from the spec is now usedisAnySchemaparameters no longer crashes withNameError: name 'Any' is not definedand now honors spec-provided examplesAnyno longer crash at runtime withTypeError: typing.Any cannot be used with isinstance()ImportError: cannot import name 'Any' from <sdk>.modelshttps:///) no longer raiseValueErrorat SDK import timeFileNotFoundErrorfor missing test fixtures_FOO_) are now properly sanitizedAdded
ApiContextservice methods withkind: 'graphql', mapping field arguments tovariablesSchemaand return types to bothresponseDataSchemaand GraphQL-awareresponseEnvelopeSchemafor downstream generatorsID,String,Int,Float,Boolean) and the commonUploadextension scalar into shared schema types, with custom scalars conservatively mapping toANYwhile preserving original names intypeDefinitionfor downstream specializationQueryandMutation), ensuring stable SDK surfaces across regenerations even when the schema defines custom root type namesFixed
#/paths/~1api~1v2~1warehouses/get/responses/202) now resolve correctly instead of throwing invalid reference errorssdkConfig.inferServiceNames: falseoption now prevents service fragmentation; when disabled, all requests collapse into a single root service named aftersdkName, restoring the flat client surface for collections converted from OpenAPI specsinfield (Postman implicitly defaults toheader; SDKs were previously selecting the wrong scheme from the spec)AcceptandContent-Typeas method parameters; both are transport-layer headers managed by the SDK itself, and exposing them (especially Postman's defaultAccept: application/json) caused 406 NotAcceptable errors against endpoints with different declared response typesAcceptorContent-Typeas header parameters no longer surface them as method parameters, bringing the generator into compliance with OpenAPI 3.0 §4.7.12.1application/json; JSON examples with unparseable bodies (e.g. placeholder strings) are downgraded totext/plainto match postman2openapi's inferenceContent-Type: application/jsonheaders on multipart and urlencoded requests (common on image uploads and form submissions) now generate SDKs that send the correct content type; the generator now followsbody.modeinstead of request-level headers for these casesinstance: 'instance (Instance name)',endpoint: 'https://api.example.com (Domain of your API)') now generate SDKs with correct URLs and method signatures; the postman-mapper strips trailing(description)annotations, drops self-referential placeholder values that would otherwise inline as constant URL segments instead of path parameters, and defensively coerces non-string variable values (numbers, booleans, null)Security
homepage, authorname/email) are now sanitized at the config ingestion chokepoint to prevent template injection through generated build manifests; literal break-out characters (quotes, backticks, braces, angle-brackets, backslash) are stripped while ordinary prose (URLs, descriptive sentences, names with punctuation) is preservedFixed
Field,TypeAdapter), typing constructs (Optional,Union,List,Any,Annotated,TYPE_CHECKING),enum.Enum, or local SDK utilities (BaseModel,BaseError) are now disambiguated with a numeric suffix (e.g.,Field1,List2), preventing import shadowing that would crash SDKs at class-definition timeList[Any]orDict[str, Any]properties now correctly importtyping.Any, fixing import errors that made SDKs unusableAnytype fields now correctly importtyping.Any, even when those fields live on deeply-nested submodelsPydanticSchemaGenerationErrorat import timeoneOfandanyOfunions now correctly emit the data class variantAdded
ApiContextservice methods withkind: 'graphql', mapping field arguments tovariablesSchemaand return types to bothresponseDataSchemaand GraphQL-awareresponseEnvelopeSchemafor downstream generatorsFixed
#/paths/~1api~1v2~1warehouses/get/responses/202) now resolve correctly instead of throwing invalid reference errorssdkConfig.inferServiceNames: falseoption now prevents service fragmentation; when disabled, all requests collapse into a single root service named aftersdkName, restoring the flat client surface for collections converted from OpenAPI specsinfield (Postman implicitly defaults toheader; SDKs were previously selecting the wrong scheme from the spec)AcceptandContent-Typeas method parameters; both are transport-layer headers managed by the SDK itself, and exposing them (especially Postman's defaultAccept: application/json) caused 406 NotAcceptable errors against endpoints with different declared response typesAcceptorContent-Typeas header parameters no longer surface them as method parameters, bringing the generator into compliance with OpenAPI 3.0 §4.7.12.1application/json; JSON examples with unparseable bodies (e.g. placeholder strings) are downgraded totext/plainto match postman2openapi's inferenceContent-Type: application/jsonheaders on multipart and urlencoded requests (common on image uploads and form submissions) now generate SDKs that send the correct content type; the generator now followsbody.modeinstead of request-level headers for these casesinstance: 'instance (Instance name)',endpoint: 'https://api.example.com (Domain of your API)') now generate SDKs with correct URLs and method signatures; the postman-mapper strips trailing(description)annotations, drops self-referential placeholder values that would otherwise inline as constant URL segments instead of path parameters, and defensively coerces non-string variable values (numbers, booleans, null)Security
Fixed
Fixed
https://{{subdomain}}.api.example.com) no longer fail during client initialization with URI parsing errorsFeatures
Bug Fixes
Spec changes
Your Python SDK has been generated for the first time from your spec.