{"id":21528228,"url":"https://github.com/znsio/swagger-parser-sample","last_synced_at":"2025-07-20T15:02:30.131Z","repository":{"id":249820124,"uuid":"832645670","full_name":"znsio/swagger-parser-sample","owner":"znsio","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-23T13:12:29.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-17T18:51:54.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/znsio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-23T12:44:10.000Z","updated_at":"2024-07-23T13:12:32.000Z","dependencies_parsed_at":"2024-07-23T15:25:59.537Z","dependency_job_id":null,"html_url":"https://github.com/znsio/swagger-parser-sample","commit_stats":null,"previous_names":["znsio/swagger-parser-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/znsio/swagger-parser-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fswagger-parser-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fswagger-parser-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fswagger-parser-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fswagger-parser-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znsio","download_url":"https://codeload.github.com/znsio/swagger-parser-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fswagger-parser-sample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266143940,"owners_count":23883067,"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-24T01:52:16.886Z","updated_at":"2025-07-20T15:02:30.107Z","avatar_url":"https://github.com/znsio.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swagger-parser-sample\n\n## How to Run\n\n1. Run the [`Main.kt`](src/main/kotlin/Main.kt) file and observe the output:\n   ```shell\n   ./gradlew run\n    ```\n\n2. Execute the [`ReferenceTest.kt`](src/test/kotlin/ReferenceTest.kt) file and observe the assertions:\n   ```shell\n   ./gradlew test\n    ```\n   \n## Description\n\nWhen using OpenAPI Specification where the operations of an endpoint are being referenced using another file, \nthe examples are parsed as strings rather than objects in the absence of a reference.\n\n![schema_diff](https://github.com/user-attachments/assets/4be8cedb-82a8-4840-b419-a4b212a34379)\n\nAs observed in the image above, the only distinction is that the operations under `/products` are referenced in `V1`, \nwhereas no such reference exists in `V2`. When flattened out both `V1` and `V2` are identical. However, \nthe example value and example type do not match when these specifications are parsed.\n\n## Expected Behavior\n\nThe examples in both `V1` and `V2` should be parsed consistently as JSON Object.\n\n## Actual Behavior\n\nIn `V1`, where the operations are referenced:\n```shell\nV1 Example Value: {id=1, name=XYZ Product, inventory=100}\nV1 Example Value Type: class java.util.LinkedHashMap\n```\n\nIn `V2`, where no reference exists:\n```shell\nV2 Example Value: {\"id\":\"1\",\"name\":\"XYZ Product\",\"inventory\":100}\nV2 Example Value Type: class com.fasterxml.jackson.databind.node.ObjectNode\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznsio%2Fswagger-parser-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznsio%2Fswagger-parser-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznsio%2Fswagger-parser-sample/lists"}