{"id":20494053,"url":"https://github.com/jaystack/odata-v4-service-document","last_synced_at":"2025-04-13T17:21:34.496Z","repository":{"id":57313448,"uuid":"61360769","full_name":"jaystack/odata-v4-service-document","owner":"jaystack","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-23T14:52:07.000Z","size":42,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-27T08:11:22.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaystack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-17T09:06:12.000Z","updated_at":"2023-03-29T23:19:20.000Z","dependencies_parsed_at":"2022-09-20T23:22:00.813Z","dependency_job_id":null,"html_url":"https://github.com/jaystack/odata-v4-service-document","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-service-document","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-service-document/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-service-document/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaystack%2Fodata-v4-service-document/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaystack","download_url":"https://codeload.github.com/jaystack/odata-v4-service-document/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290019,"owners_count":21078923,"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":[],"created_at":"2024-11-15T17:38:01.680Z","updated_at":"2025-04-13T17:21:34.468Z","avatar_url":"https://github.com/jaystack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OData V4 Service Document\n\nUsing this module you can generate a service document response from a simple JSON format, an advanced schema JSON format or an Edmx instance created with [odata-v4-metadata](https://github.com/jaystack/odata-v4-metadata).\n\n## Basic usage\n\nUse the simple JSON format and convert your metadata JSON to a service document.\n\n```javascript\nvar serviceDocument = require('odata-v4-service-document').ServiceDocument;\n\n// service document express.js route\napp.get('/odata', ServiceDocument.defineEntities({\n    namespace: 'Default',\n    containerName: 'Container',\n    entities: [\n        {\n            name: 'Kitten',\n            collectionName: 'Kittens',\n            keys: ['Id'],\n            computedKey: true,\n            properties: {\n                Id: 'Edm.String',\n                Name: 'Edm.String',\n                Age: 'Edm.Int32',\n                Lives: 'Edm.Int32',\n                Owner: 'Edm.String'\n            },\n            annotations:[\n                { name: 'UI.DisplayName', value: 'Meww' },\n                { property: 'Id', name: 'UI.ReadOnly', value: 'true' },\n                { property: 'Title', name: 'UI.DisplayName', value: 'Meww Meww' },\n            ]\n        }\n    ]\n}).requestHandler());\n```\n\n## Advanced usage\n\nUse a schema JSON, which is more verbose, but you can customize the metadata in a more advanced way.\n\n```javascript\nvar ServiceDocument = require('odata-v4-service-document').ServiceDocument;\nvar schema = require('./schema');\nvar serviceDocument = ServiceDocument.processMetadataJson(schema);\nvar serviceDocumentJson = serviceDocument.document();\n```\n\n\nAn example schema JSON looks like [this](https://raw.githubusercontent.com/jaystack/odata-v4-service-document/master/tests/schema2.json)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaystack%2Fodata-v4-service-document","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaystack%2Fodata-v4-service-document","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaystack%2Fodata-v4-service-document/lists"}