{"id":13495712,"url":"https://github.com/palantir/conjure","last_synced_at":"2026-01-07T14:15:42.597Z","repository":{"id":37546105,"uuid":"134616422","full_name":"palantir/conjure","owner":"palantir","description":"Strongly typed HTTP/JSON APIs for browsers and microservices","archived":false,"fork":false,"pushed_at":"2025-05-14T21:05:38.000Z","size":6771,"stargazers_count":438,"open_issues_count":67,"forks_count":69,"subscribers_count":277,"default_branch":"master","last_synced_at":"2025-05-14T22:20:07.910Z","etag":null,"topics":["octo-correct-managed"],"latest_commit_sha":null,"homepage":"https://palantir.github.io/conjure/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/palantir.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog/4.10.0/pr-532.v2.yml","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-23T19:28:43.000Z","updated_at":"2025-05-14T21:05:41.000Z","dependencies_parsed_at":"2023-09-28T23:32:29.752Z","dependency_job_id":"5560ae44-c1a2-4aa5-af01-94473058c128","html_url":"https://github.com/palantir/conjure","commit_stats":null,"previous_names":[],"tags_count":86,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palantir%2Fconjure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palantir%2Fconjure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palantir%2Fconjure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palantir%2Fconjure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palantir","download_url":"https://codeload.github.com/palantir/conjure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["octo-correct-managed"],"created_at":"2024-07-31T19:01:37.430Z","updated_at":"2026-01-07T14:15:42.553Z","avatar_url":"https://github.com/palantir.png","language":"Java","funding_links":[],"categories":["Java","微服务库"],"sub_categories":[],"readme":"\u003cp align=\"right\"\u003e\n\u003ca href=\"https://autorelease.general.dmz.palantir.tech/palantir/conjure\"\u003e\u003cimg src=\"https://img.shields.io/badge/Perform%20an-Autorelease-success.svg\" alt=\"Autorelease\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/media/conjure-flat.svg\" alt=\"Conjure logo\" height=\"200\" width=\"200\" id=\"readme-logo\"\u003e\n\n# Conjure\n\u003c/p\u003e\n\n_Conjure is a simple but opinionated toolchain for defining APIs once and generating client/server interfaces in multiple languages._\n\nConjure was developed to help scale Palantir's microservice architecture - it has been battle-tested across hundreds of repos and has allowed devs to be productive in many languages.\n\nDefine your API once and then Conjure will generate idiomatic clients for Java, TypeScript, Python etc. The generated interfaces provide type-safe, clean abstractions so you can make network requests without worrying about the details.\n\nFor example in Java, Conjure interfaces allow you to build servers using existing Jersey compatible libraries like Dropwizard/Jetty.\n\n**See an [example below](#example), or check out our [getting started](docs/getting_started.md) guide to define your first Conjure API.**\n\n\n## Features\n- Enables teams to work together across many languages\n- Eliminates an entire class of serialization bugs\n- Abstracts away low-level details behind ergonomic interfaces\n- Expressive language to model your domain (enums, union types, maps, lists, sets)\n- Helps preserve backwards compatibility (old clients can talk to new servers)\n- Supports incremental switchover from existing JSON/HTTP servers\n- Zero config (works out of the box)\n\n\n## Ecosystem\nThe Conjure compiler reads API definitions written in the concise, [human-readable YML format](/docs/spec/conjure_definitions.md) and produces a JSON-based [intermediate representation](/docs/spec/intermediate_representation.md) (IR).\n\n_Conjure generators_ read IR and produce code in the target language. The associated libraries provide client and server implementations. Each generator is distributed as a CLI that conforms to [RFC002](/docs/rfc/002-contract-for-conjure-generators.md):\n\n| Language | Generator | Libraries | Examples |\n|--------------------|-------------------------------|-|-|\n| Java | [conjure-java](https://github.com/palantir/conjure-java) | [conjure-java-runtime](https://github.com/palantir/conjure-java-runtime) | [conjure-java-example](https://github.com/palantir/conjure-java-example) |\n| TypeScript | [conjure-typescript](https://github.com/palantir/conjure-typescript) | [conjure-typescript-runtime](https://github.com/palantir/conjure-typescript-runtime) | [conjure-typescript-example](https://github.com/palantir/conjure-typescript-example) |\n| Python | [conjure-python](https://github.com/palantir/conjure-python) | [conjure-python-client](https://github.com/palantir/conjure-python-client) | - |\n| Rust | [conjure-rust](https://github.com/palantir/conjure-rust) | - | - |\n| Go   | [conjure-go](https://github.com/palantir/conjure-go) | [conjure-go-runtime](https://github.com/palantir/conjure-go-runtime) | - |\n\nThe [gradle-conjure](https://github.com/palantir/gradle-conjure) _build tool_ is the recommended way of interacting with the Conjure ecosystem as it seamlessly orchestrates all the above tools. Alternatively, the compiler and generators may also be invoked [manually](/docs/howto/invoke_clis_manually.md#how-to-invoke-conjure-clis-manually) as they all behave in a consistent way (specified by [RFC002](/docs/rfc/002-contract-for-conjure-generators.md)).\n\nThe [conjure-verification](https://github.com/palantir/conjure-verification) tools allow Conjure generator authors to verify that their generators and libraries produce code that complies with the [wire spec](/docs/spec/wire.md).\n\nThe following tools also operate on IR:\n\n- [conjure-postman](https://github.com/palantir/conjure-postman) - generates [Postman](https://www.getpostman.com/) [Collections](https://learning.getpostman.com/docs/postman/collections/intro-to-collections/) for interacting with Conjure defined APIs.\n- conjure-backcompat - an experimental type checker that compares two IR definitions to evaluate whether they are wire format compatible (not yet open-sourced).\n\n\n## Example\nThe following YAML file defines a simple Flight Search API. (See [concepts](/docs/concepts.md))\n\n```yaml\ntypes:\n  definitions:\n    default-package: com.palantir.flightsearch\n    objects:\n\n      Airport:\n        alias: string\n      SearchRequest:\n        fields:\n          from: Airport\n          to: Airport\n          time: datetime\n      SearchResult:\n        alias: list\u003cConnection\u003e\n      Connection:\n        fields:\n          from: Airport\n          to: Airport\n          number: string\n\nservices:\n  FlightSearchService:\n    name: Flight Search Service\n    package: com.palantir.flightsearch\n    base-path: /flights\n    endpoints:\n\n      search:\n        docs: Returns the list of flight connections matching a given from/to/time request.\n        http: POST /search\n        args:\n          request: SearchRequest\n        returns: SearchResult\n\n      list:\n        docs: Returns flights departing from the given airport on the given day.\n        http: GET /list/{airport}/{time}\n        args:\n          airport: Airport\n          time: datetime\n        returns: SearchResult\n```\n\nThe following generated Java interface can be used on the client and the server.\n\n```java\npackage com.palantir.flightsearch;\n\n...\n\n@Consumes(MediaType.APPLICATION_JSON)\n@Produces(MediaType.APPLICATION_JSON)\n@Path(\"/\")\n@Generated(\"com.palantir.conjure.java.services.JerseyServiceGenerator\")\npublic interface FlightSearchService {\n    /** Returns the list of flight connections matching a given from/to/time request. */\n    @POST\n    @Path(\"flights/search\")\n    SearchResult search(SearchRequest request);\n\n    /** Returns flights departing from the given airport on the given day. */\n    @GET\n    @Path(\"flights/list/{airport}/{time}\")\n    SearchResult list(@PathParameter(\"airport\") Airport airport, @PathParameter(\"time\") OffsetDateTime time);\n}\n```\n\nType-safe network calls to this API can made from TypeScript as follows:\n\n```ts\nfunction demo(): Promise\u003cSearchResult\u003e {\n    const request: ISearchRequest = {\n        from: \"LHR\",\n        to: \"JFK\",\n        number: \"BA117\"\n    };\n    return new FlightSearchService(bridge).search(request);\n}\n```\n\n## Contributing\nSee the [CONTRIBUTING.md](/CONTRIBUTING.md) document.\n\n## License\nThis tooling is made available under the [Apache 2.0 License](https://github.com/palantir/conjure/blob/master/LICENSE).\n\u003c!-- intentionally not using a '/LICENSE' link because docsify always appends .md which results in a 404 --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalantir%2Fconjure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalantir%2Fconjure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalantir%2Fconjure/lists"}