diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e5bbc..5906447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.0.2] - 2019-11-28 + +### Added + +- Allow for specifying subjects explicitly [#19](https://github.com/kafkajs/confluent-schema-registry/pull/19) + +### Fixed + +- Fix `@types/jest` issue [#29](https://github.com/kafkajs/confluent-schema-registry/pull/29) +- Fix `es-abstract` version issue [28](https://github.com/kafkajs/confluent-schema-registry/pull/28) + ## [1.0.1] - 2019-10-25 ### Added diff --git a/package.json b/package.json index ff8698a..c680047 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kafkajs/confluent-schema-registry", - "version": "1.0.1", + "version": "1.0.2", "main": "dist/index.js", "description": "ConfluentSchemaRegistry is a library that makes it easier to interact with the Confluent schema registry, it provides convenient methods to encode, decode and register new schemas using the Apache Avro serialization format.", "keywords": [ diff --git a/src/SchemaRegistry.spec.ts b/src/SchemaRegistry.spec.ts index db122fe..71ef4ad 100644 --- a/src/SchemaRegistry.spec.ts +++ b/src/SchemaRegistry.spec.ts @@ -57,8 +57,9 @@ describe('SchemaRegistry', () => { it('fetch and validate the latest schema id after registering a new schema', async () => { const { id } = await schemaRegistry.register(Schema) - const latestSchemaId = await schemaRegistry.getLatestSchemaId(subject); - expect(id).toBe(latestSchemaId); + const latestSchemaId = await schemaRegistry.getLatestSchemaId(subject) + + expect(id).toBe(latestSchemaId) }) it('set the default compatibility to BACKWARD', async () => { diff --git a/src/SchemaRegistry.ts b/src/SchemaRegistry.ts index 816ca3e..495a396 100644 --- a/src/SchemaRegistry.ts +++ b/src/SchemaRegistry.ts @@ -44,12 +44,11 @@ export default class SchemaRegistry { throw new ConfluentSchemaRegistryArgumentError(`Invalid namespace: ${schema.namespace}`) } - /* !note: allow user to decide the subject name */ - let subject: string; + let subject: string if (userOpts && userOpts.subject) { - subject = userOpts.subject + subject = userOpts.subject } else { - subject = [schema.namespace, schema.name].join(separator) + subject = [schema.namespace, schema.name].join(separator) } try { diff --git a/website/README.md b/website/README.md index f3da77f..0566861 100755 --- a/website/README.md +++ b/website/README.md @@ -2,11 +2,11 @@ This website was created with [Docusaurus](https://docusaurus.io/). # What's In This Document -* [Get Started in 5 Minutes](#get-started-in-5-minutes) -* [Directory Structure](#directory-structure) -* [Editing Content](#editing-content) -* [Adding Content](#adding-content) -* [Full Documentation](#full-documentation) +- [Get Started in 5 Minutes](#get-started-in-5-minutes) +- [Directory Structure](#directory-structure) +- [Editing Content](#editing-content) +- [Adding Content](#adding-content) +- [Full Documentation](#full-documentation) # Get Started in 5 Minutes @@ -16,6 +16,7 @@ This website was created with [Docusaurus](https://docusaurus.io/). # Install dependencies $ yarn ``` + 2. Run your dev server: ```sh @@ -72,6 +73,7 @@ For more information about docs, click [here](https://docusaurus.io/docs/en/navi Edit blog posts by navigating to `website/blog` and editing the corresponding post: `website/blog/post-to-be-edited.md` + ```markdown --- id: post-needs-edit @@ -121,6 +123,7 @@ For more information about adding new docs, click [here](https://docusaurus.io/d 1. Make sure there is a header link to your blog in `website/siteConfig.js`: `website/siteConfig.js` + ```javascript headerLinks: [ ... @@ -151,6 +154,7 @@ For more information about blog posts, click [here](https://docusaurus.io/docs/e 1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`: `website/siteConfig.js` + ```javascript { headerLinks: [ @@ -175,6 +179,7 @@ For more information about the navigation bar, click [here](https://docusaurus.i 1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element: `website/siteConfig.js` + ```javascript { headerLinks: [