Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@ember-data/serializer
Advanced tools
Provides Legacy JSON, JSON:API and REST Implementations of the Serializer Interface for use with @ember-data/store
Provides JSON, REST and JSON:API Implementations of the legacy Serializer Interface
Caution ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used. If starting a new app or thinking of implementing a new serializer, consider writing a Handler instead to be used with the RequestManager
This package is currently installed when installing ember-data
.
If installing @ember-data/
packages individually install using your javascript package manager of choice. For instance with pnpm
pnpm add @ember-data/serializer
Tagged Releases
If using ember-data
no additional setup is necesssary.
Note When using ember-data the below configuration is handled for you automatically.
To use legacy serializers you will need to have installed and configured the LegacyNetworkHandler from @ember-data/legacy-compat
pnpm add @ember-data/legacy-compat
import Store, { CacheHandler } from '@ember-data/store';
import RequestManager from '@ember-data/request';
import { LegacyNetworkHandler } from '@ember-data/legacy-compat';
export default class extends Store {
requestManager = new RequestManager();
constructor(args) {
super(args);
this.requestManager.use([LegacyNetworkHandler]);
this.requestManager.useCache(CacheHandler);
}
}
To use as either a per-type or application serializer, export one of the
implementations within the serializers/
directory of your app as appropriate.
For instance, to configure an application serializer to use JSON:API
app/serializers/application.ts
export { default } from '@ember-data/serializer/json-api';
By default serializers are resolved by looking for a serializer with the same name in the serializers/
folder as the type
given to store.serializerFor(<type>)
, falling back to looking for a serializer named application
.
Overriding Resolution
If you would like to avoid using resolver semantics and your application has only one or a few serializers, you may ovveride the serializerFor
hook on the store.
import Store from '@ember-data/store';
import Serializer from '@ember-data/serializer/json-api';
class extends Store {
#serializer = new Serializer();
serializerFor() {
return this.#serializer;
}
}
For the full list of APIs available read the code documentation for @ember-data/serializer. You may also be interested in learning more about EmberData's Serializer Interface.
FAQs
Provides Legacy JSON, JSON:API and REST Implementations of the Serializer Interface for use with @ember-data/store
We found that @ember-data/serializer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.