{"id":14976109,"url":"https://github.com/goodforgod/dummymapper","last_synced_at":"2025-10-27T18:30:28.959Z","repository":{"id":40340972,"uuid":"222238973","full_name":"GoodforGod/DummyMapper","owner":"GoodforGod","description":"IntelliJ IDEA plugin for mapping Java class to JSON/AVRO/GraphQL.","archived":false,"fork":false,"pushed_at":"2024-04-14T09:19:27.000Z","size":595,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-01T07:31:41.653Z","etag":null,"topics":["avro","avro-schema","code-tools","graphql","graphql-schema","intellij","intellij-idea","intellij-plugin","java","json","json-mapping","json-schema","kotlin","mapping","mapping-tools","plugin","pojo-to-avro","pojo-to-graphql","pojo-to-json"],"latest_commit_sha":null,"homepage":"https://plugins.jetbrains.com/plugin/14911","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/GoodforGod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2019-11-17T11:40:56.000Z","updated_at":"2024-11-15T02:46:12.000Z","dependencies_parsed_at":"2023-10-11T11:38:32.768Z","dependency_job_id":"53eb653f-8a47-4bc1-8174-dde9fbf5b32b","html_url":"https://github.com/GoodforGod/DummyMapper","commit_stats":{"total_commits":196,"total_committers":2,"mean_commits":98.0,"dds":"0.025510204081632626","last_synced_commit":"2d6993da0b086db7251e928c93774157fa85d453"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2FDummyMapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2FDummyMapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2FDummyMapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodforGod%2FDummyMapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodforGod","download_url":"https://codeload.github.com/GoodforGod/DummyMapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238536077,"owners_count":19488649,"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":["avro","avro-schema","code-tools","graphql","graphql-schema","intellij","intellij-idea","intellij-plugin","java","json","json-mapping","json-schema","kotlin","mapping","mapping-tools","plugin","pojo-to-avro","pojo-to-graphql","pojo-to-json"],"created_at":"2024-09-24T13:53:19.187Z","updated_at":"2025-10-27T18:30:23.661Z","avatar_url":"https://github.com/GoodforGod.png","language":"Java","readme":"# DummyMapper 🗎\n\n![Java CI](https://github.com/GoodforGod/DummyMapper/workflows/CI%20Master/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_DummyMapper\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=GoodforGod_DummyMapper)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_DummyMapper\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=GoodforGod_micronaut-arangodb)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_DummyMapper\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=GoodforGod_DummyMapper)\n\n[Intellij IDEA plugin](https://plugins.jetbrains.com/plugin/14911-dummymapper-json-avro-graphql-/) \nfor mapping Java or Kotlin Classes to format like [JSON](#json)/[AVRO](#avro-schema)/[GraphQL](#graphql)/etc.\n\n![](https://media.giphy.com/media/VelLohLlWETYZBNWlt/giphy.gif)\n\n## Content\n- [Installation](#installation)\n- [Format Support](#format-support)\n  - [Json](#json)\n  - [Json Schema](#json-schema)\n  - [Avro Schema](#avro-schema)\n  - [GraphQL](#graphql)\n- [Limitations](#limitations)\n\n## Installation\n\n- Install using [Intellij Plugin marketplace](https://plugins.jetbrains.com/plugin/14911-dummymapper-json-avro-graphql-/):\n  - Navigate to [site](https://plugins.jetbrains.com/plugin/14911-dummymapper-json-avro-graphql-/) and click *install* button there.\n- Using IDE built-in plugin system on:\n  - **[Windows]** \u003ckbd\u003eFile\u003c/kbd\u003e \u003e \u003ckbd\u003eSettings\u003c/kbd\u003e \u003e \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003eMarketplace\u003c/kbd\u003e \u003e \u003ckbd\u003eSearch for \"DummyMapper\"\u003c/kbd\u003e \u003e \u003ckbd\u003eInstall\u003c/kbd\u003e\n  - **[MacOS]** \u003ckbd\u003ePreferences\u003c/kbd\u003e \u003e \u003ckbd\u003eSettings\u003c/kbd\u003e \u003e \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003eMarketplace\u003c/kbd\u003e \u003e \u003ckbd\u003eSearch for \"DummyMapper\"\u003c/kbd\u003e \u003e \u003ckbd\u003eInstall\u003c/kbd\u003e\n- Manually:\n  - Download the [latest release](https://github.com/goodforgod/DummyMapper/releases/latest), compile with *./gradlew buildPlugin* and install it manually using \u003ckbd\u003eFile\u003c/kbd\u003e \u003e \u003ckbd\u003eSettings\u003c/kbd\u003e \u003e \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003e⚙️\u003c/kbd\u003e \u003e \u003ckbd\u003eInstall Plugin from Disk...\u003c/kbd\u003e\n\n## Format Support\n\nPlugin allow mapping Java or Kotlin Classes to different formats, \nthis section describes information about supported formats and their options.\n\nAll format examples will be showed according to this class as example.\nKeep in mind that mapping is based on class **fields**, not *getters\\setters*.\n\n```java\npublic class User {\n\n    private class Credential {\n        private String id;\n        private long issued;\n    }\n\n    private UUID id;\n    private String name;\n    private List\u003cString\u003e roles;\n    private Credential credential;\n}\n```\n\nSupports also Kotlin classes:\n```kotlin\ndata class ExampleData(val surname: String, val number: Int, val simple: ExampleSimple)\n\nclass ExampleSimple {\n\n    var en: ExampleEnum? = null\n    var name: String? = null\n    var data: ExampleData? = null\n    var surnames: List\u003cString\u003e? = null\n    var numbers: Map\u003cString, Int\u003e? = null\n    var names: Set\u003cString\u003e? = null\n}\n```\n\n### Json\n\nPlugin uses [DummyMaker library](https://github.com/GoodforGod/dummymaker) for generating classes and then converting to JSON format.\n\nAllow mapping class as JSON example with fields filled with\nrandom values as if class example was serialized to JSON format.\n- \u003ckbd\u003eMapping options..\u003c/kbd\u003e \u003e \u003ckbd\u003eMap as JSON\u003c/kbd\u003e\n\n```json\n{\n  \"id\" : \"76fbb591-8e95-4df7-94ad-5d0606709141\",\n  \"name\" : \"Alan\",\n  \"roles\" : [ \"herbalist\", \"recycling-officer\", \"exploration-geologist\" ],\n  \"credential\" : {\n    \"id\" : \"a7ec6315-4292-454c-ac69-e61a7a36e07d\",\n    \"issued\" : 1565743683\n  }\n}\n```\n\nAlso allow mapping class as array of JSONs.\n- \u003ckbd\u003eMapping options..\u003c/kbd\u003e \u003e \u003ckbd\u003eMap as JSON Array\u003c/kbd\u003e\n\nYou can specify number of entries to generate in array.\n\n```json\n[\n  {\n    \"id\": \"526686d0-8d84-4b85-a751-77fa7a157a69\",\n    \"name\": \"Rachel\",\n    \"roles\": [ \"fitness-centre-manager\", \"plant-breeder\", \"television-production-assistant\" ],\n    \"credential\": {\n      \"id\": \"94f349c9-405a-4921-8dbf-8abfacc28cf1\",\n      \"issued\": 1548018277\n    }\n  }\n]\n```\n\n![](https://media.giphy.com/media/VelLohLlWETYZBNWlt/giphy.gif)\n\n#### Annotations Support\n\nAnnotations from [Jackson](https://www.baeldung.com/jackson-annotations) are supported when serializing to JSON, \nbut keep in mind that only *fields* used for serialization, not *getters*. \n\nHowever, [Jackson annotations](https://www.baeldung.com/jackson-annotations) from respected fields *getters*\nwill be applied during serialization if found, but such behavior is not guarantied to be always correct.\n\nExample for *User* class:\n```java\npublic class User {\n    \n    private UUID id;\n    @JsonProperty(value = \"firstName\")\n    private String name;\n    private String surname;\n    @JsonIgnore\n    private List\u003cString\u003e roles;\n\n    @JsonIgnore\n    public String getSurname() {\n        return surname;\n    }\n}\n```\n\nMapping *User* class as JSON will result in (most of [Jackson annotations](https://www.baeldung.com/jackson-annotations)\nand their parameters are supported):\n```json\n{\n  \"id\": \"975e80ed-b95d-46b2-9338-519ff7083dd3\",\n  \"firstName\": \"Alfred\"\n}\n```\n\n### Json Schema\n\nAllow mapping class as JSON Schema, 3 different drafts are available:\n- [Draft 2020-12](https://json-schema.org/draft/2020-12/release-notes.html)\n- [Draft 2019-09](https://json-schema.org/draft/2019-09/release-notes.html)\n- [Draft 7](https://json-schema.org/draft-07/json-schema-release-notes.html)\n- [Draft 6](https://json-schema.org/draft-06/json-schema-release-notes.html)\n\nMapping is under:\n- \u003ckbd\u003eMapping options..\u003c/kbd\u003e \u003e \u003ckbd\u003eMap as JSON Schema\u003c/kbd\u003e\n\n```json\n{\n  \"$schema\": \"https://json-schema.org/draft/2019-09/schema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"credential\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"string\"\n        },\n        \"issued\": {\n          \"type\": \"integer\"\n        }\n      }\n    },\n    \"id\": {\n      \"type\": \"string\"\n    },\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"roles\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    }\n  }\n}\n```\n\n![](https://media.giphy.com/media/YMY6Rd9fxUkIU4BoKF/giphy.gif)\n\n### Avro Schema\n\nAllow mapping class as AVRO Schema for [version 1.9.2](https://avro.apache.org/docs/1.9.2/)\n\nThere is option for two different AVRO Schema builders like:\n- [Jackson](https://github.com/FasterXML/jackson-dataformats-binary/tree/master/avro)\n- [Apache](https://avro.apache.org/docs/1.9.2/gettingstartedjava.html)\n\nMapping is under:\n- \u003ckbd\u003eMapping options..\u003c/kbd\u003e \u003e \u003ckbd\u003eMap as AVRO Schema\u003c/kbd\u003e\n\n```json\n{\n  \"type\" : \"record\",\n  \"name\" : \"User\",\n  \"namespace\" : \"io.goodforgod.dummymapper\",\n  \"fields\" : [ {\n    \"name\" : \"id\",\n    \"type\" : {\n      \"type\" : \"record\",\n      \"name\" : \"UUID\",\n      \"namespace\" : \"java.util\",\n      \"fields\" : [ ]\n    }\n  }, {\n    \"name\" : \"name\",\n    \"type\" : \"string\"\n  }, {\n    \"name\" : \"roles\",\n    \"type\" : {\n      \"type\" : \"array\",\n      \"items\" : \"string\",\n      \"java-class\" : \"java.util.List\"\n    }\n  }, {\n    \"name\" : \"credential\",\n    \"type\" : {\n      \"type\" : \"record\",\n      \"name\" : \"Credential\",\n      \"fields\" : [ {\n        \"name\" : \"id\",\n        \"type\" : \"string\"\n      }, {\n        \"name\" : \"issued\",\n        \"type\" : \"long\"\n      } ]\n    }\n  } ]\n}\n```\n\n#### Jackson Annotation Support\n\n[Jackson annotations](https://www.baeldung.com/jackson-annotations) are supported when serializing to AVRO Schema, \nbut keep in mind that only *fields* used for serialization, not *getters*. \n\nMost of [Jackson annotations](https://www.baeldung.com/jackson-annotations)\nand their parameters are supported.\n\nExample on how to mark field as required (Option *Required By Default* apply such transformation for all fields if selected):\n```java\npublic class User {\n    \n    @JsonProperty(required = true)\n    private UUID id;\n    private String name;\n    private String surname;\n}\n```\n\n#### Apache Annotation Support\n\nAnnotations from [Apache Avro](https://github.com/apache/avro/tree/master/lang/java/avro/src/main/java/org/apache/avro/reflect) library supported when serializing to AVRO Schema.\n\n### GraphQL\n\nAllow mapping class as GraphQL query with [version v14](https://www.graphql-java.com/documentation/v14)\n\nMapping is under:\n- \u003ckbd\u003eMapping options..\u003c/kbd\u003e \u003e \u003ckbd\u003eMap as GraphQL\u003c/kbd\u003e\n\n```text\nschema {\n  query: Query\n}\n\ntype Credential {\n  id: String\n  issued: Long!\n}\n\n#Query root\ntype Query {\n  credential: Credential\n  id: UUID\n  name: String\n  roles: [String]\n}\n\n#Long type\nscalar Long\n\n#Unrepresentable type\nscalar UNREPRESENTABLE\n\n#UUID String\nscalar UUID\n```\n\n#### Annotation Support\n\nAnnotations from [GraphQL SPQR](https://github.com/leangen/graphql-spqr/tree/master/src/main/java/io/leangen/graphql/annotations) library supported when serializing to GraphQL.\n\n## Limitations\n\nThere some limitations for plugin when mapping classes:\n- *Enums* are not supported and thus will be displayed as *String* fields, except for *Map as JSON* where enum values will be generated correctly.\nThis issue is due to library used in plugin unable to create Java Enums.\n- Getters, Setters not used for any mapping, *only annotations from getters* are used for mapping (depends on operation)\nif found. Standard Java naming convention expected from *getters* to be found.\n- Annotations Class Params are not supported. Thus, most of annotation parameters like String, Boolean, etc. are supported, but Class or other complex parameters not supported.\n\n## Licence\n\nThis project licensed under the Apache 2.0 - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodforgod%2Fdummymapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodforgod%2Fdummymapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodforgod%2Fdummymapper/lists"}