multipart-payload-editor

WebJar for multipart-payload-editor

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

org.webjars.bowergithub.advanced-rest-client
ArtifactId

ArtifactId

multipart-payload-editor
Last Version

Last Version

2.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

multipart-payload-editor
WebJar for multipart-payload-editor
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/advanced-rest-client/multipart-payload-editor

Download multipart-payload-editor

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/multipart-payload-editor/ -->
<dependency>
    <groupId>org.webjars.bowergithub.advanced-rest-client</groupId>
    <artifactId>multipart-payload-editor</artifactId>
    <version>2.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/multipart-payload-editor/
implementation 'org.webjars.bowergithub.advanced-rest-client:multipart-payload-editor:2.0.2'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.advanced-rest-client/multipart-payload-editor/
implementation ("org.webjars.bowergithub.advanced-rest-client:multipart-payload-editor:2.0.2")
'org.webjars.bowergithub.advanced-rest-client:multipart-payload-editor:jar:2.0.2'
<dependency org="org.webjars.bowergithub.advanced-rest-client" name="multipart-payload-editor" rev="2.0.2">
  <artifact name="multipart-payload-editor" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.advanced-rest-client', module='multipart-payload-editor', version='2.0.2')
)
libraryDependencies += "org.webjars.bowergithub.advanced-rest-client" % "multipart-payload-editor" % "2.0.2"
[org.webjars.bowergithub.advanced-rest-client/multipart-payload-editor "2.0.2"]

Dependencies

compile (20)

Group / Artifact Type Version
org.webjars.bowergithub.advanced-rest-client : markdown-styles jar [2.0.1,3)
org.webjars.bowergithub.polymerelements : paper-button jar [2.1.0,3)
org.webjars.bowergithub.advanced-rest-client : api-property-form-item jar [2.0.1,3)
org.webjars.bowergithub.polymer : polymer jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : paper-autocomplete jar [2.0.0,3)
org.webjars.bowergithub.advanced-rest-client : api-form-mixin jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : iron-flex-layout jar [2.0.3,3)
org.webjars.bowergithub.polymerelements : iron-collapse jar [2.2.0,3)
org.webjars.bowergithub.polymerelements : paper-input jar [2.2.0,3)
org.webjars.bowergithub.polymerelements : paper-spinner jar [2.1.0,3)
org.webjars.bowergithub.polymerelements : iron-validatable-behavior jar [2.1.0,3)
org.webjars.bowergithub.advanced-rest-client : multipart-payload-transformer jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : iron-form jar [2.2.1,3)
org.webjars.bowergithub.advanced-rest-client : arc-icons jar [2.0.2,3)
org.webjars.bowergithub.advanced-rest-client : clipboard-copy jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : prism-element jar [2.1.0,3)
org.webjars.bowergithub.polymerelements : marked-element jar [2.4.0,3)
org.webjars.bowergithub.advanced-rest-client : prism-common jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-toast jar [2.0.0,3)
org.webjars.bowergithub.polymerelements : paper-icon-button jar [2.2.0,3)

Project Modules

There are no modules declared in this project.

Published on NPM

Build Status

Published on webcomponents.org

multipart-payload-editor

An AMF powered multipart payload editor for the HTTP request editor.

<multipart-payload-editor></multipart-payload-editor>

Version compatibility

This version only works with AMF model version 2 (AMF parser >= 4.0.0). For compatibility with previous model version use 3.x.x version of the component.

Usage

Installation

npm install --save @advanced-rest-client/multipart-payload-editor

In an html file

<html>
  <head>
    <script type="module">
      import '@advanced-rest-client/multipart-payload-editor/multipart-payload-editor.js';
    </script>
  </head>
  <body>
    <multipart-payload-editor></multipart-payload-editor>
  </body>
</html>

In a LitElement

import { LitElement, html } from 'lit-element';
import '@api-components/multipart-payload-editor/multipart-payload-editor.js';

class SampleElement extends PolymerElement {
  render() {
    return html`
    <multipart-payload-editor
      .model="${this.modelValue}"
      @value-changed="${this._handleValue}"
      @model-changed="${this._handleModel}"></multipart-payload-editor>
    `;
  }

  _handleValue(e) {
    this.headersValue = e.detail.value;
  }

  _handleModel(e) {
    this.modelValue = e.detail.value;
  }
}
customElements.define('sample-element', SampleElement);

Generating view model from AMF model

When you have API model generated by AMF parser you can use api-view-model-transformer element to produce view model for the editor. This element produces common model for query parametrs, URI parameters, body, and headers.

<api-view-model-transformer @view-model-changed="${this._viewModelChanged}"></api-view-model-transformer>
<multipart-payload-editor></multipart-payload-editor>

<script>
{
  const api = await generateApiModel();
  const endpoint = '/api-endpoint';
  const operation = 'GET';
  const payloadModelArray = getOperationPayloadFromModel(api, endpoint, operation); // some abstract method
  const transformer = document.querySelector('api-view-model-transformer');
  transformer.api = api; // This is required to compute ld+json keys!
  const viewModel = transformer.computeViewModel(headersModelArray);
  document.querySelector('multipart-payload-editor').model = viewModel;
}
</script>

Development

git clone https://github.com/advanced-rest-client/multipart-payload-editor
cd multipart-payload-editor
npm install

Running the demo locally

npm start

Running the tests

npm test

API components

This components is a part of API components ecosystem

org.webjars.bowergithub.advanced-rest-client

ARC

A set of repositories related to the Advanced REST Client and API console (by Mulesoft)

Versions

Version
2.0.2