{"id":37463100,"url":"https://github.com/specificlanguages/mps-to-json-exporter","last_synced_at":"2026-01-16T07:06:25.583Z","repository":{"id":37965537,"uuid":"421059734","full_name":"specificlanguages/mps-to-json-exporter","owner":"specificlanguages","description":"Export MPS language structure as JSON Schema and MPS models as JSON documents.","archived":false,"fork":false,"pushed_at":"2025-03-07T16:35:04.000Z","size":2731,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-07T17:32:12.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JetBrains MPS","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/specificlanguages.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":"2021-10-25T14:32:26.000Z","updated_at":"2025-03-07T16:35:13.000Z","dependencies_parsed_at":"2025-03-07T17:36:45.536Z","dependency_job_id":null,"html_url":"https://github.com/specificlanguages/mps-to-json-exporter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/specificlanguages/mps-to-json-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/specificlanguages%2Fmps-to-json-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/specificlanguages%2Fmps-to-json-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/specificlanguages%2Fmps-to-json-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/specificlanguages%2Fmps-to-json-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/specificlanguages","download_url":"https://codeload.github.com/specificlanguages/mps-to-json-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/specificlanguages%2Fmps-to-json-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-16T07:06:25.531Z","updated_at":"2026-01-16T07:06:25.578Z","avatar_url":"https://github.com/specificlanguages.png","language":"JetBrains MPS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mps-to-json-exporter\n\nExport MPS language structure as JSON Schema and MPS models as JSON documents.\n\n# Exporting MPS Structure as JSON Schema\n\nCreate an empty model, use language `com.specificlanguages.metamodel2jsonschema`.\n\nIn the export configuration specify the schema ID and the languages to export. You can also specify individual concepts.\nDo not specify enums, they are ignored.\n\nYou can specify properties to ignore, they work for properties, children and references.\n\nYou can specify a class that will be used during preprocessing of the generator. \nThe intention is that you can add NodeAttributees to nodes, and that they will than be exported as well.\nThis can be used to get derived information, which is not in the model itself, to the export.\n\nNow you can build the model or preview the generated text.\n\n# JSON Schema Output Notes\n\n**Scope (transitive closure):** the output schema contains definitions for each concept in each included language. In\naddition, all superconcepts, link target concepts, and enumeration declarations used by properties are included,\nrecursively.\n\n**Described structure:** the generated schema describes a JSON array whose each item is a root node. The schema thus\ndescribes an array of root nodes, i.e. a model.\n\n**Representing inheritance:** the schema contains a separate \"exact\" definition for each non-abstract concept. In\naddition, the schema contains a \"subconcepts\" definition for every concept, including abstract concepts and interfaces.\nThe \"\nsubconcepts\" definition lists all known subconcepts with \"oneOf\", so that the resulting schema will validate any known\nsubconcept of that concept. The \"exact\" schemas are used for root nodes, whereas the \"subconcept\" schemas are used for\nlink targets.\n\n**Closed world:** related to the above point, JSON Schema in general is not extensible so the generated schema will only\nbe valid for the listed languages and their transitive closure but will not allow any instances of concepts that were\nnot known at the time of its generation.\n\n**Node structure:** each node is represented by an object that contains at least a field named `$id` with the node ID,\nand a field named `$concept` with the node's concept. In addition, each node object will contain properties and links (\nchild and reference).\n\n**Additional Properties** The Schema sets _additionalProperties_ to _false_ to make the validation as strict as possible.\n\n**Required** As of now no property is required in the Schama.\n\n# Exporting MPS Root as JSON\n\nDefine a model2json root:\n\n- specify the root that you want to export to JSON.\n- specify the schema-export that was used to export the corresponding JSON schema, \n  this will ensure that the exported JSON can be validated by the schema, e.g. ignored properties are taken into\n  account in both the schema and the JSON.\n\n# Concept and Language Reference\n\n## Language com.specificlanguages.metamodel2jsonschema\n\n### Concept MetamodelToJsonSchemaExport\n\nConfigures the schema export. Specifies the following pieces of information:\n\n* schema meta-information (`schemaId`, `schemaTitle`, `schemaDescription`),\n* set of complete languages and/or individual concepts to be exported (`completeLanguages`, `additionalConcepts`,\n  `additionalEnums`).\n* properties to ignore during export (`ignoredProperties`),\n* an _extender_ to add computed information to exported nodes, such as types of expressions (`nodeAttributeExtender`).\n\nThe extender does not take any effect at the stage of exporting the metamodel to JSON schema but is called at the later\nstage of exporting a particular model as JSON.\n\n## Language com.specificlanguages.metamodel2java\n\nThis language does not define any concepts of its own but provides a generator that, given\na `MetamodelToJsonSchemaExport` node, will produce a Java data class for each concept, together with a method to\nread node data from JSON. \n\n## Language com.specificlanguages.model2json\n\n### Concept Model2Json\n\nMarks a model for exporting as JSON. Given a model that contains an instance of Model2Json, the generator of the concept\nwill export the entire model (except for the Model2Json node itself) as JSON.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspecificlanguages%2Fmps-to-json-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspecificlanguages%2Fmps-to-json-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspecificlanguages%2Fmps-to-json-exporter/lists"}